[Rd] wilcox.exact function (PR#8856)
pat.hodgson at sympatico.ca
pat.hodgson at sympatico.ca
Fri May 12 16:32:42 CEST 2006
Full_Name: Patrick Hodgson
Version: 2.0
OS: solaris 2.9
Submission from: (NULL) (65.94.128.161)
The value reported for the parameter W in the function wilcox.exact appears to
be incorrect. I have checked the reference in the help file for this function
(Myles & Hollander 1973, as well as 2nd ed. 1999 by same authors) and it is
clear that W is the sum of the ranks of the data set with the smaller number of
members.
Here is sample input/output:
> x<-c(1,2,3,4,5,6,7,8,9,10)
> y<-c(11,12,13,14,15)
> library(exactRankTests)
> wil<-wilcox.exact(x,y)
> wil
Exact Wilcoxon rank sum test
data: x and y
W = 0, p-value = 0.000666
alternative hypothesis: true mu is not equal to 0
In this case W should be the sum of the ranks of y (coincidentally also the
values of the y data)= 11+12+13+14+15 = 65.
W of zero is ridiculous.
Similarly, in this case W should be 2+4+6+8 = 20, not 10 as reported.
> x<-c(1,3,5,7,9)
> y<-c(2,4,6,8)
> wil<-wilcox.exact(x,y)
> wil
Exact Wilcoxon rank sum test
data: x and y
W = 10, p-value = 1
alternative hypothesis: true mu is not equal to 0
More information about the R-devel
mailing list