[R] Creating a correlation Matrix

Romain Francois francoisromain at free.fr
Mon Feb 7 17:54:11 CET 2005


Le 07.02.2005 16:58, Jessica Higgs a écrit :

> 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.
>
Hello,

that is not that huge and what is wrong with ?cor

A <- matrix(rnorm(21*3471),ncol=21) #you should replace A by your data
matcor <- cor(A) #that is your correlation matrix
image(matcor) # and how to watch it
heatmap(matcor) # an other way to watch it


Hope this helps.
Romain

-- 
Romain FRANCOIS : francoisromain at free.fr
page web : http://addictedtor.free.fr/  (en construction)
06 18 39 14 69 / 01 46 80 65 60
_______________________________________________________
Etudiant en 3eme année
Institut de Statistique de l'Université de Paris (ISUP)
Filière Industrie et Services
http://www.isup.cicrp.jussieu.fr/




More information about the R-help mailing list