How to use it
- Paste the first measurement of each pair into Sample 1 and the second into Sample 2, in the same order.
- Or leave Sample 2 empty and enter a hypothesised median to test one sample.
- Choose the alternative hypothesis and read W, the p-value and the result.
How the test works
- Take each difference d = sample 1 − sample 2 (or value − median) and drop the zeros; n differences remain.
- Rank the absolute differences |d|, giving tied values the average of their ranks.
- W⁺ is the sum of ranks of positive differences and W⁻ of negative ones; W⁺ + W⁻ = n(n + 1)/2.
- Normal approximation: μ = n(n + 1)/4, σ² = n(n + 1)(2n + 1)/24 − Σ(t³ − t)/48, z = (W⁺ − μ ∓ ½)/σ.
- Effect size: matched-pairs rank-biserial correlation = (W⁺ − W⁻)/(W⁺ + W⁻).
Worked example
Blood pressure after and before for 8 people: after 125, 118, 130, 142, 121, 135, 128, 140; before 120, 117, 122, 130, 123, 126, 121, 131.
Differences: 5, 1, 8, 12, −2, 9, 7, 9. Ranks of |d|: 1 → 1, 2 → 2, 5 → 3, 7 → 4, 8 → 5, the two 9s → 6.5 each, 12 → 8. Only −2 is negative, so W⁻ = 2 and W⁺ = 36 − 2 = 34. With the tie, σ² = 8 × 9 × 17/24 − 6/48 = 50.875, σ = 7.13, z = (34 − 18 − 0.5)/7.13 = 2.17, two-tailed p = 0.030.
Tips and common mistakes
- Keep the pairs in the same order in both boxes; shuffling one list ruins the test.
- For two independent groups, use the Mann–Whitney U test instead.
- Many zero differences reduce the usable sample; heavily rounded measurements are the usual cause.