[R] Correlation Matrix in R

R. Michael Weylandt michael.weylandt at gmail.com
Wed Oct 26 05:09:19 CEST 2011


I believe it has to do with the "complete.obs" choice and the presence
of NAs in your data. The differences should vanish with
"pairwise.complete.obs" but whether that's what you want is up to you.


Michael

On Tue, Oct 25, 2011 at 5:09 PM, AlexC <alexandre.chausson at unil.ch> wrote:
> Hi,
>
> I am currently working with a data set which contains a list of julian dates
> of phenological (flowering, leaf growth etc.)
>
> I obtained a correlation matrix by simply using the cor function with the
> dataset cor(dataset,use="complete.obs")
>
> that gives me a correlation matrix but the correlations are somehow
> different from when I run individual correlations using the cor function and
> the same correlation method.  When a smaller sub data set (3 columns) is
> created from the original (27 colums) this does NOT occur!
>
> I am a little confused by this,
> If anyone knows the reason please let me know.
> Otherwise I'm looking for another way to get a correlation matrix.  I do not
> know how to write a loop function to do individual correlations
>
> Thank you for your help.
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Correlation-Matrix-in-R-tp3938274p3938274.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org 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.
>



More information about the R-help mailing list