Re: [Rd] Incorrect handling of NA's in cor() (PR#6750)

2004-04-09 Thread ligges
[EMAIL PROTECTED] wrote: Full_Name: Marek Ancukiewicz Version: 1.8.1 OS: Linux Submission from: (NULL) (132.183.12.87) Function cor() incorrectly handles missing observation with method=spearman: x - c(1,2,3,NA,5,6) y - c(4,NA,2,5,1,3) cor(x,y,use=complete.obs,method=s) [1]

Re: [Rd] Incorrect handling of NA's in cor() (PR#6750)

2004-04-09 Thread msa
Dear Uwe, You are wrong. First, I've read the help file before submitting the report. For two variables, use=pairwise.complete.obs and use=complete.obs should be equivalent, shouldn't it? Of sourse, the results will be different when we have more than 2 variables. Second, with the call you

Re: [Rd] Incorrect handling of NA's in cor() (PR#6750)

2004-04-09 Thread ligges
Marek Ancukiewicz wrote: Dear Uwe, You are wrong. Whoops. My apologies!!! In R-1.9.0 beta I get: cor(x[!is.na(x)!is.na(y)],y[!is.na(x)!is.na(y)],method=s) # [1] -0.4 cor(x,y,use=complete.obs, method=s) # [1] -0.5291503 I'll take a look! Uwe First, I've read the help file before

Re: [Rd] Incorrect handling of NA's in cor() (PR#6750)

2004-04-09 Thread Thomas Lumley
On Fri, 9 Apr 2004 [EMAIL PROTECTED] wrote: Dear Uwe, You are wrong. First, I've read the help file before submitting the report. For two variables, use=pairwise.complete.obs and use=complete.obs should be equivalent, shouldn't it? Of sourse, the results will be different when we have

Re: [Rd] Incorrect handling of NA's in cor() (PR#6750)

2004-04-09 Thread tlumley
On Fri, 9 Apr 2004, Marek Ancukiewicz wrote: Dear Thomas, The question becomes: how do we rank missing values? That's one of the questions. It's not the only question. Suppose x has no missing values but y has a missing value. Should the ranks for x be based on the whole vector or just on