Re: [R] bug in cor (..., use= ...)?

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

From: Prof Brian Ripley (ripley@stats.ox.ac.uk)
Date: Mon 24 May 2004 - 17:08:12 EST


Message-id: <Pine.LNX.4.44.0405240805580.23344-100000@gannet.stats>


>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@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@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

______________________________________________ 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:12 EST