Wilcoxon test statistic

312 Views Asked by At

I learned WSR (Wilcoxon signed rank test) several years ago, and today one of my friends suggest different test statistics on WSR. At first, I thought he was wrong; however, I did found some sources which were citing the positive rank sum as W test statistic. Such as these links suggests: http://courses.wcupa.edu/rbove/Berenson/CD-ROM%20Topics/topice-10_5.pdf http://www.stat.umn.edu/geyer/5601/notes/wilcox.pdf

According to my undergrads stat, we choose the min(W+,W-) as the test statistic. for example: http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_Nonparametric/BS704_Nonparametric6.html

On wiki, it suggest that W = abs(W+ minus W-). https://en.wikipedia.org/wiki/Wilcoxon_signed-rank_test#Test_procedure

Why does WSR test has so many "alternative" test statistics? Is there many versions of WSR? When to use which test statistics? I am confused now. Please share any insights with me, many thanks.

#

I would like to edit this question. I just tried to write functions to calculate z scores in r. using two equations below, I was able to get same absolute z-scores using Negative rank sum, Positive rank sum, or absolute rank sum:

these data were replicates from an online source https://www.youtube.com/watch?v=TqCg2tb4wJ0

n =non-zero ranking sample size

w+ = 75

w- = 16

|w| = 75-16=59

n = 13

for neg or pos

z <- function(w,n){ (w-(n*(n+1)/4))/(sqrt((n*(n+1)*(2*n+1)/24)))

}

for absolute

z1 <- function(w,n){ (w)/sqrt((n*(n+1)*(2*n+1))/6) }

z(75,13) [1] 2.061627

z(16,13) [1] -2.061627

z1(59,13) [1] 2.061627

But I'm still confused with it... Should it considered to be irresponsible for articles and papers to use positive rank sum as w test statistics? Usually people use critical values sheet of w to determine the result right? http://users.stat.ufl.edu/~winner/tables/wilcox_signrank.pdf

On the case above(the youtube link), if we use positive rank sum, the result would be completely opposite.

Please let me know if I was thinking in the right direction.

1

There are 1 best solutions below

1
On BEST ANSWER

Example of 2-sample tests in R and in Minitab (software at hand at the moment):

R (simulate fake data):

x1 = round(rnorm(30, 100, 15),2);  x2 = round(rnorm(25, 110, 15),2)
sort(x1)
 [1]  67.38  68.20  79.60  80.39  82.42  83.11  84.65  86.45  90.36  93.48  94.14
[12]  97.65  99.56 101.25 102.01 102.63 103.66 103.98 105.82 105.89 106.30 112.02
[23] 113.57 113.73 114.68 117.58 119.63 119.92 120.97 133.46
sort(x2)
 [1]  81.53  91.60  95.55 100.34 102.89 103.39 104.81 105.00 106.02 106.43 106.51
[12] 111.37 111.70 113.26 113.73 114.05 115.09 117.22 118.29 121.24 127.69 132.60
[23] 137.79 137.97 143.20

Output

wilcox.test(x1, x2)

        Wilcoxon rank sum test with continuity correction

data:  x1 and x2
W = 218.5, p-value = 0.008366
alternative hypothesis: true location shift is not equal to 0

Warning message:
In wilcox.test.default(x1, x2) : cannot compute exact p-value with ties

Minitab (input same data used in R):

MTB > set c1
DATA>   67.38  68.20  79.60  80.39  82.42  83.11  84.65  86.45  90.36  93.48  94.14
DATA>   97.65  99.56 101.25 102.01 102.63 103.66 103.98 105.82 105.89 106.30 112.02
DATA>  113.57 113.73 114.68 117.58 119.63 119.92 120.97 133.46
DATA> end
MTB > set c2
DATA>   81.53  91.60  95.55 100.34 102.89 103.39 104.81 105.00 106.02 106.43 106.51
DATA>  111.37 111.70 113.26 113.73 114.05 115.09 117.22 118.29 121.24 127.69 132.60
DATA>  137.79 137.97 143.20
DATA> end
MTB > Mann-Whitney C1 C2;
SUBC>   Alternative 0.

Output

Mann-Whitney Test: C1, C2 

     N  Median
C1  30  102.32
C2  25  111.70

Point estimate for η1 - η2 is -11.57
W = 683.5
Test of η1 = η2 vs η1 ≠ η2 is significant at 0.0084
The test is significant at 0.0084 (adjusted for ties)

Notice that the "W-statistics" differ, but the P-values are 0.0084 in both software packages. The observation 113.73 happens to occur in both samples. This causes minor difficulties with the distribution theory, handled slightly differently by the two programs.