[Rd] Something strange in cor.test in R-1.8.0 (PR#4718)
Kurt Hornik
Kurt.Hornik at wu-wien.ac.at
Thu Oct 23 13:04:15 MEST 2003
>>>>> maechler writes:
>>>>> "Duncan" == Duncan Murdoch <dmurdoch at pair.com>
>>>>> on Wed, 22 Oct 2003 08:17:32 -0400 writes:
Duncan> I've now tried the code
> set.seed(1)
> x <- rnorm(50)
> y <- rnorm(50)
> cor.test(x,y,method="spearman")
> x <- rnorm(50)
> y <- rnorm(50)
> cor.test(x,y,method="spearman")
Duncan> in r-patched (which gives apparently correct results), and r-devel,
Duncan> which gives the first result correct, the second incorrect; when
Duncan> repeated, both are bad.
> Hmm,
> funny.
> I get repeatable results in in R 1.7.1 , 1.8.0, R-patched and
> R-devel (all on Linux),
> with an (ugly but convenient) 1-liner :
>> set.seed(1); for(k in 1:2){x <- rnorm(50);y <- rnorm(50);print(unlist(cor.test(x,y,method="spearman")[1:4]))}
> statistic.S p.value estimate.rho
> 23640.0000000 0.3482088 -0.1351741
> statistic.S p.value estimate.rho
> 1.724800e+04 2.322263e-01 1.717647e-01
I get the same on Debian GNU/Linux.
Where do we stand on this? Windows-specific?
-k
More information about the R-devel
mailing list