[R] The W statistic in wilcox.exact

Jue.Wang2 at sanofi-aventis.com Jue.Wang2 at sanofi-aventis.com
Thu Oct 5 19:35:05 CEST 2006


Does anyone know why wilcox.exact gives W-statistic 6 instead of 12 as indicated below.

12 is the rank sum of group 0 of x, which is the linear statistic computed by wilcox_test.

y<-c(1,2,3,4,5)
x<-c(1,1,0,0,0)


(a) wilcox.exact

wilcox.exact(y~x)
Exact Wilcoxon rank sum test
data:  y by x 
W = 6, p-value = 0.2
alternative hypothesis: true mu is not equal to 0 


(b) wilcox_test

tt<-wilcox_test(y~factor(x),distribution="exact")
statistic(tt,"linear")
   
0 12



Jue Wang, Biostatistician
Contracted Position for Preclinical & Research Biostatistics
PrO Unlimited
(908) 231-3022



More information about the R-help mailing list