[R] Bug in cor.test - Spearman

Marc Schwartz MSchwartz at medanalytics.com
Fri Nov 7 16:23:53 CET 2003

On Fri, 2003-11-07 at 08:45, Steve Roberts wrote:
> Greetings.
> There seems to be a problem with the P-value computation in the 
> cor.test with method="spearman". In R1.8.0  (MS Windows) I 
> seem to be getting intermittently nonsense P-values, but the rho's 
> are OK. I can get this reproducibly with the toy example attached 
> where the first use is OK and subsequent calls with the same data 
> give nonsense. (I have also seen the problem without the warning 
> about duplicated values.) The toy example behaves correctly under 
> 1.7.1.


This is PR#4718, which appears to be fixed in R 1.8.1:


I don't know that a pre-compiled version of r-patched for Windows is

If not, then the 'rcorr' function in Frank Harrell's Hmisc package my be
a short term solution for you until R 1.8.1 becomes available.


Marc Schwartz

More information about the R-help mailing list