Rank two independent samples together and test whether one tends to sit higher, with every value's rank shown, the rank sum W, its expected value and the p-value.
W = sum of sample 1's ranks · E(W) = n₁(N + 1) ÷ 2
The Wilcoxon rank-sum test pools two samples, ranks every value from smallest to largest, and checks whether one sample's ranks add up to more than chance would allow.
If the samples come from the same population, their ranks should be shuffled together and each sample's rank sum should be near its fair share. A sample that grabs most of the high ranks has a rank sum well above that share.
Frank Wilcoxon published it in 1945; Mann and Whitney's U test, two years later, is the same test in a different form. Seeing the ranks laid out, as this page does, makes it easy to check the working by hand.
As introduced by Wilcoxon (1945); see also Hollander, Wolfe and Chicken. See Sources.
W and Mann–Whitney's U differ by a constant, U₁ = W − n₁(n₁ + 1)/2, so the p-values match exactly.
The fertilised plants took the top four ranks and most of the rest. That's good evidence the fertiliser helps, without assuming heights are normally distributed.
All 12 heights in order. Fertilised plants are sample 1.
| Height | Group | Rank |
|---|---|---|
| 22 cm | Control | 1 |
| 25 cm | Control | 2 |
| 26 cm | Control | 3 |
| 27 cm | Control | 4 |
| 28 cm | Fertiliser | 5 |
| 29 cm | Control | 6 |
| 30 cm | Fertiliser | 7 |
| 31 cm | Control | 8 |
| 33 cm | Fertiliser | 9 |
| 35 cm | Fertiliser | 10 |
| 37 cm | Fertiliser | 11 |
| 40 cm | Fertiliser | 12 |
Yes. W and U are linked by U₁ = W − n₁(n₁ + 1)/2, and both give the same p-value. The Mann–Whitney calculator shows U and the probability of superiority.
Either. Swapping them changes W but not the two-sided p-value.
Sample 1’s values, so you can see at a glance whether they bunch at the top or bottom of the ranking.
R reports U₁, the Mann–Whitney form, under the name W. It’s W from this page minus n₁(n₁ + 1)/2.
Yes, but expect many ties. The p-value then comes from the normal approximation with a tie correction.
No, any sizes work.
Technically 2 each, but with fewer than about 4 per group no result can reach significance at 5%.
Only slightly with normal data, about 95% as efficient. With skewed data or outliers it’s often more powerful.
Related Tools