[R] Spearman probabilities and SuppDists

Drew Hoysak dhoysak at ccs.carleton.ca
Thu May 20 18:57:20 CEST 2004


cor.test and SuppDists give me different P-values for the same
Spearman's rho.  Which is correct, or am I doing something wrong?



> x <- c(44.4, 45.9, 41.9, 53.3, 44.7, 44.1, 50.7, 45.2, 60.1)
> y <- c( 2.6,  3.1,  2.5,  5.0,  3.6,  4.0,  5.2,  2.8,  3.8)

> cor.test(x,y,method="spearman")

	Spearman's rank correlation rho

data:  x and y 
S = 48, p-value = 0.0968
alternative hypothesis: true rho is not equal to 0 
sample estimates:
rho 
0.6 


> 2*(1-pSpearman(.6,9))
[1] 0.08572531





Drew Hoysak




More information about the R-help mailing list