On 14 Apr 2014, at 05:02 , Paul Tanger paul.tan...@colostate.edu wrote:
Thanks, I did not realize it was deleting rows! I was afraid to try
pairwise.complete.obs because it said something about resulting in a
matrix which is not positive semi-definite (and googling that term
just confused
Hi,
I can't seem to figure out why this gives me different answers. Probably
something obvious, but I thought they would be the same.
This is an minimal example from the help page of cor() :
## swM := swiss with 3 missings :
swM - swiss
colnames(swM) - abbreviate(colnames(swiss), min=6)
Please post in plain text per the Posting Guide.
Read ?cor, particularly the part about complete.cases. Your two cases have
different effective input rows.
---
Jeff NewmillerThe . .
Hi,
I think in this case, when you use na.or.complete, all the NA rows are
removed for the full dataset.
cor(swM[-1,1:2])
# FrtltyAgrclt
#Frtlty 1.000 0.3920289
#Agrclt 0.3920289 1.000
cor(swM[-1,])[1:2,1:2]
#FrtltyAgrclt
#Frtlty 1.000 0.3920289
#Agrclt
Thanks, I did not realize it was deleting rows! I was afraid to try
pairwise.complete.obs because it said something about resulting in a
matrix which is not positive semi-definite (and googling that term
just confused me more). But I ran the dataset through JMP and got the
same answers so I
5 matches
Mail list logo