Skip to content
Prev 12349 / 63461 Next

Incorrect handling of NA's in cor() (PR#6750)

On Fri, 9 Apr 2004 msa@biostat.mgh.harvard.edu wrote:

            
I think it's more complicated than either of you are considering.

For the Pearson correlation everything is straightforward, and
pairwise.complete is the same as complete, which is the same as dropping
the NAs manually.

For the rank correlations the question is when the ranking should be done.
The cor() function ranks the observations and then drops missing values,
the manual approach drops missing values and then ranks.

I'm not convinced that it is obvious which of these is right, though
certainly the help page should document whichever is being done.


	-thomas