[R] bug in cor (..., use= ...)?
Prof Brian Ripley
ripley at stats.ox.ac.uk
Mon May 24 09:08:12 CEST 2004
>From the NEWS file for 1.9.0
o The cor() function did not remove missing values in the
non-Pearson case.
Your example works correctly there. (I am fairly sure this has been
discussed on the mailing lists.)
On Mon, 24 May 2004 Lorenz.Gygax at fat.admin.ch wrote:
> Dear R users,
>
> I have not found anything on this in the archives. Does anyone know whehther
> the parameter use= is not functioning in cor or enlighten me what it is
> supposed to do?
>
> My R version is "R version 1.8.1, 2003-11-21" on Windows 2000. I am hoping
> to be able to update to 1.9.1 as soon as it has appeared (we are not allowed
> here to install software on our own and thus I am trying to be able to have
> the .1 versions installed ...).
>
> Test code:
>
> x <- 1:10
> y <- 2:11
>
> x [1] <- NA
> y [10] <- 12
>
> cor (x, y, use= 'all.obs', method= 'kendall')
> cor (x, y, use= 'complete.obs', method= 'kendall')
> cor (x, y, use= 'pairwise.complete.obs', method= 'kendall')
>
> As I understand, the first one of this should result in an error which it
> does not. All the results are the same and seemingly treat the NA as if it
> was 0.
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list