Wilcoxon Test Explained: How to Make, Read and Report It
The Wilcoxon signed-rank test compares two related measurements, such as before and after scores on the same people, using the ranks of the differences. It is the usual rank-based alternative to the paired t-test when differences are ordinal, skewed or based on small samples.
What it tests
It tests whether the distribution of paired differences is centred on zero. Assumptions: pairs are independent of each other, the outcome is at least ordinal, and differences can be meaningfully ranked. For the usual interpretation as a test of the median difference, the distribution of differences should be roughly symmetric. Do not confuse it with the Wilcoxon rank-sum test, which is equivalent to Mann-Whitney U for independent groups.
Calculation
di = afteri − beforei; rank |di|; W+ = Σ ranks of positive d; W− = Σ ranks of negative d
Zero differences are dropped, and W+ + W− = n(n+1)/2. The matched-pairs rank-biserial correlation is r = (W+ − W−) / [n(n+1)/2].
Original example (illustrative)
Eight patients' symptom scores improve by the following amounts after a mindfulness course (positive = improvement): 3, 5, −1, 4, 2, 6, 7, 8.
The absolute values 1, 2, 3, 4, 5, 6, 7, 8 are all distinct, so their ranks equal the values. Only one difference is negative (−1, rank 1), so W− = 1 and W+ = 36 − 1 = 35. The test statistic is T = min(W+, W−) = 1. Under H0 all 28 = 256 sign patterns are equally likely; only two give W− ≤ 1 (none, or rank 1 negative), so the exact two-sided p = 2 × 2/256 = .016. The rank-biserial correlation is (35 − 1)/36 = .94, and the median difference is 4.5.
This is a large and consistent improvement, but without a control group it cannot show that the course caused it.
How to make it in StatFAS
Open the Wilcoxon Test Calculator. Use two columns, one per time point, with one row per participant.
APA 7 reporting
A Wilcoxon signed-rank test showed that symptom scores improved after the course (Mdndifference = 4.5), T = 1, p = .016, rrb = .94, n = 8 pairs.
Note that some software reports W+ rather than the smaller sum, so state which statistic you are reporting.
Common mistakes and alternatives
Using it on independent groups, ignoring ties and zeros (which require approximations), applying it to a non-symmetric difference distribution while claiming a median test, and overinterpreting small samples. If differences are approximately normal, use the paired t-test. For binary paired data, use McNemar's test; for more than two repeated conditions use the Friedman test.
Conclusion
The Wilcoxon signed-rank test uses both the direction and the size ordering of paired changes, and it should be reported with an effect size and a clear statement of design.
1.
statfas-wilcoxon-test-interface.png, alt: "StatFAS Wilcoxon Test Calculator interface"2.
statfas-wilcoxon-test-example-data.png, alt: "Example data entered in the StatFAS Wilcoxon Test Calculator"3.
statfas-wilcoxon-test-settings.png, alt: "Wilcoxon Test Calculator settings in StatFAS"4.
statfas-wilcoxon-test-result.png, alt: "Wilcoxon Test Calculator result generated in StatFAS"References
- Wilcoxon, F. (1945). Individual comparisons by ranking methods. Biometrics Bulletin, 1(6), 80–83.