Re: [R] cor and missing values. Bug?

About this list Date view Thread view Subject view Author view Attachment view

From: Peter Dalgaard (p.dalgaard@biostat.ku.dk)
Date: Thu 27 May 2004 - 08:20:17 EST


Message-id: <x2zn7u4yqm.fsf@biostat.ku.dk>


"Robert W. Baer, Ph.D." <rbaer@atsu.edu> writes:

> > Not to put too fine a point on it, but did you consider checking the
> > NEWS file for the most recent version (1.9.0,
> > http://cran.r-project.org/src/base/NEWS)?
> >
> > o The cor() function did not remove missing values in the
> > non-Pearson case.
>
>
> There is still something a little strange in version 1.9.0. What is the
> source of the discrpancy between cor() and cor.test()?

One ranks x and y before removing missing values, the other one
removes them first and then ranks. It is not really desirable, but a
better solution is nontrivial (esp. in the "pairwise.complete.obs"
case) and we did document it in ?cor:

                  Notice also that the ranking is (currently) done
     removing only cases that are missing on the variable itself,
     which may not be what you expect if you let 'use' be '"complete.obs"'
     or '"pairwise.complete.obs"'.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907

______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:13 EST