Correlation Matrix

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Correlation Matrix

mahdi
Could anyone can help me telling the way how I can build correlation matrix in R? Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: Correlation Matrix

Cren
Hi,

unless you're dealing with heteroskedastic datas, the command cor(x) will be enough, where x is your data matrix; in this function you can easily select the method which has to be used: Pearson's, Kendall's or Spearman's correlation.
Reply | Threaded
Open this post in threaded view
|

Re: Correlation Matrix

mahdi
Thanks a lot. Suppose I want to use Pearson's method, then what I have to do?
Reply | Threaded
Open this post in threaded view
|

Re: Correlation Matrix

Joshua Wiley-2
Hi Mahdi,

Look at the documentation for cor(), by typing ?cor or help("cor").
Pearson is the default and it is trivial to select the others.  I
suggest you try searching google or reading R's documentation before
posting to the list.  You may not understand it all, but it shows you
tried to work on your own and let's you ask more specific questions.
For example: I am using function foo(), and read the documentation,
but was confused by this paragraph "some paragraph from docs for foo".
 Then we can come along and so oh, what that means is _____.

Cheers,

Josh

On Thu, May 17, 2012 at 7:22 AM, mahdi <[hidden email]> wrote:

> Thanks a lot. Suppose I want to use Pearson's method, then what I have to do?
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Correlation-Matrix-tp4630389p4630396.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



--
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Correlation Matrix

Bert Gunter
Josh:

A very nice, clear, polite, concise, and reasoned alternative to "RTFM" !

Probably should be templated somehow, given the volume of queries of
this sort that this list receives. (The posting guide is too involved
to serve in its stead.)

Cheers,
Bert



On Thu, May 17, 2012 at 9:31 AM, Joshua Wiley <[hidden email]> wrote:

> Hi Mahdi,
>
> Look at the documentation for cor(), by typing ?cor or help("cor").
> Pearson is the default and it is trivial to select the others.  I
> suggest you try searching google or reading R's documentation before
> posting to the list.  You may not understand it all, but it shows you
> tried to work on your own and let's you ask more specific questions.
> For example: I am using function foo(), and read the documentation,
> but was confused by this paragraph "some paragraph from docs for foo".
>  Then we can come along and so oh, what that means is _____.
>
> Cheers,
>
> Josh
>
> On Thu, May 17, 2012 at 7:22 AM, mahdi <[hidden email]> wrote:
>> Thanks a lot. Suppose I want to use Pearson's method, then what I have to do?
>>
>> --
>> View this message in context: http://r.789695.n4.nabble.com/Correlation-Matrix-tp4630389p4630396.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>
>
> --
> Joshua Wiley
> Ph.D. Student, Health Psychology
> Programmer Analyst II, Statistical Consulting Group
> University of California, Los Angeles
> https://joshuawiley.com/
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



--

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Correlation Matrix

mahdi
In reply to this post by Joshua Wiley-2
thanks a lot dear. I will keep your advice in my mind.