The Wilcoxon signed-rank test — single and paired sample
Differences → discard zeros → rank the absolute values (average ties) → sum + and − ranks → T = smaller of the two.
When to use it. A single sample tested against a median , or a paired sample (work with the differences). The population (of values or differences) must be symmetric about its median.
The procedure — five disciplined steps:
- Differences. For a single sample, compute . For a paired sample, (pair difference).
- Discard zeros. Any is dropped, and is reduced accordingly.
- Rank the ABSOLUTE differences from smallest () to largest. Tied values share the average rank (e.g. two values tied for ranks 3 and 4 both get ).
- Re-attach the signs and sum the ranks: sum of ranks of positive , sum of ranks of negative .
- Test statistic . A small is evidence against .
Check: (the sum of all ranks to ) — a fast way to catch arithmetic slips.
Cambridge tip. The two killers are: (i) ranking the signed differences instead of the absolute differences, and (ii) forgetting to discard zeros. Build the table with a column for — it prevents both errors.
- Rank , average ties, discard zeros, reduce .
- ; small → reject .
- Check .
See the full worked example for wilcoxon signed-rank test and the wilcoxon rank-sum test →