Wilcoxon Rank-Sum Test
Pool, rank, sum, and interpret
The Wilcoxon rank-sum test compares two independent groups through their relative order. Pool the observations, assign ranks without using group labels, and then sum the ranks for one group. The resulting statistic measures whether that group tends to have larger observations than the other under a specified null model.
Pooled ranks and ties
Sort all observations from smallest to largest and give them pooled ranks from 1 through the total sample size. When equal observations occupy several positions, give each their average, called a midrank.
This prevents arbitrary ordering among equal values from changing the statistic. The rank sum RA adds the ranks held by group A; the raw measurements themselves are not added.
From rank sums to pair comparisons
For nA observations in A, their smallest possible rank sum is 1+2+⋯+nA=nA(nA+1)/2. Subtract this baseline to obtain the Mann–Whitney statistic UA=RA−nA(nA+1)/2. It counts A–B pairs for which A is larger, with half credit for a tie, and ranges from zero to nAnB.
A larger value points toward larger A observations, but its significance depends on the null distribution, not on its magnitude alone.
Worked example
Suppose A contains 10 and 16, while B contains 11 and 13. The pooled order is 10, 11, 13, 16, so A holds ranks 1 and 4. Thus RA=1+4=5 and UA=5−2(3)/2=2; directly, 16 exceeds both B observations while 10 exceeds neither. This example has no ties, but the same rank-sum formula works with midranks when ties occur.
Group A has n_A = 3 observations and pooled rank sum R_A = 12. What is U_A?
Mark Yourself Question
- Grab a piece of paper and try this problem yourself.
- When you're done, check the "I have answered this question" box below.
- View the solution and report whether you got it right or wrong.
Independent group A has values 1, 3, 3 and group B has values 2, 3, 6. Assign pooled midranks, then give R_A and U_A.