[R] Creating a correlation Matrix

Wiener, Matthew matthew_wiener at merck.com
Mon Feb 7 17:39:01 CET 2005


>From the help for cor (from the stats package):

"If x and y are matrices then the covariances (or correlations) between the
columns of x and the columns of y are computed."

So if you make a matrix with each column corresponding to one of your
variables, you can get what you're after.

For future reference, help.search("correlation") turns up the proper page as
the first suggestion.

Hope this helps,

Matt Wiener

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Jessica Higgs
Sent: Monday, February 07, 2005 10:58 AM
To: R-help at stat.math.ethz.ch
Subject: [R] Creating a correlation Matrix


Hi all:

I have a question on how to go about creating a correlation matrix.  I have 
a huge amount of data....21 variables for 3471 times. I want to see how 
each of the variables correlate to each other.  Any help would be 
appreciated, including which package and which functions I should use to do 
this.

Thanks,
Jessica Higgs

Masters Student
Department of Meteorology
Penn State University

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html




More information about the R-help mailing list