[R] Creating a correlation Matrix

Romain Francois francoisromain at free.fr
Mon Feb 7 19:20:03 CET 2005


Le 07.02.2005 18:53, Jessica Higgs a écrit :

> I've tried using cor() by the following sequence:
>
> C <- cor(x, y = NULL, use = "all.obs", method = c("pearson"))
>
In ?cor you find that :

If 'use' is '"all.obs"', then the presence of missing observations will 
produce an error.

try use="complete" instead.

Romain.

> where x is my matrix of 21 columns and 3471 rows.
>
> and I get this error:
>
> Error in cor(x, y = NULL, use = "all.obs", method = c("pearson")) :
>         missing observations in cov/cor
>
> any suggestions?
>
> At 08:32 AM 2/7/2005 -0800, Spencer Graves wrote:
>
>>      Have you considered "cor"?  The command 
>> 'help.search("correlation")' suggests among other functions 
>> "var(stats)", the documentation for which also includes "cor".
>>      If this is not adequate, "PLEASE do read the posting guide! 
>> http://www.R-project.org/posting-guide.html ".  It may help you get 
>> more useful replies in the future.      spencer graves
>>
>> Jessica Higgs wrote:
>>
>>> 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
>>
>>
>>
>
> ______________________________________________
> 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
>
>


-- 
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