Wilcoxon signed-rank test
The non-parametric alternative to the paired t-test for two repeated measurements.
6 min read
Try it
One click opens the “Teaching-method study” sample dataset with this test selected and the variables filled in. Or use your own data.
The Wilcoxon signed-rank test is the non-parametric alternative to the paired t-test. It compares two measurements from the same people using the ranks of the differences instead of the differences themselves, so it does not assume the differences are normal.
When to use it
- You have two measurements from the same people (or matched pairs), and
- the data are ordinal, such as a single Likert item before and after, or
- the differences are not normal and there are fewer than 30 pairs, or there are severe outliers.
The idea
- Compute each person's difference (first − second) and drop pairs with a difference of 0.
- Rank the size of the differences, ignoring the sign.
- Add up the ranks of the positive and the negative differences separately.
- With no change, the two sums should be similar. The statistic T is the smaller of the two sums: the smaller T, the more consistently scores moved in one direction.
Lucidstat converts T to z (with tie and continuity corrections, as R wilcox.test) and reports r = |z| ÷ √N.
Worked example
This uses the same pre-test and post-test scores as the paired t-test lesson (89 pairs).
| Measurement | n | Mdn | Q1 | Q3 |
|---|---|---|---|---|
| Pre-test | 89 | 53.00 | 48.00 | 60.50 |
| Post-test | 89 | 66.00 | 61.00 | 75.00 |
| Ranks | n | Sum of ranks |
|---|---|---|
| Positive (pre > post) | 2 | 8.5 |
| Negative (pre < post) | 87 | 3996.5 |
| Ties | 0 |
Result: T = 8.5, z = −8.16, p < .001, r = .87.
How to read it
- 87 of 89 students scored higher on the post-test, so the sum of positive ranks is tiny (T = 8.5).
- p < .001: pre-test and post-test scores differ significantly.
- r = .87 is far above the "large" benchmark of .50.
- The result agrees with the paired t-test on the same data, so the conclusion does not depend on the distribution of the differences.
A Wilcoxon signed-rank test showed that Pre-test (Mdn = 53.00) differed significantly from Post-test (Mdn = 66.00), T = 8.5, z = −8.16, p < .001, r = .87, a large effect. Pre-test was higher than Post-test for 2 of 89 pairs.
ผลการทดสอบ Wilcoxon signed-rank พบว่า คะแนนก่อนเรียน (Mdn = 53.00) และคะแนนหลังเรียน (Mdn = 66.00) แตกต่างกันอย่างมีนัยสำคัญทางสถิติที่ระดับ .05 (T = 8.5, z = −8.16, p < .001) โดยคะแนนก่อนเรียนสูงกว่าคะแนนหลังเรียน จำนวน 2 คู่จาก 89 คู่ และขนาดอิทธิพลอยู่ในระดับใหญ่ (r = .87)
Common mistakes
- Using it for two groups of different people. Use the Mann–Whitney U test.
- Not reporting pairs with zero difference, which are dropped from the calculation.
- Reading the direction from the sign of z instead of the medians.
References
- Rosenthal, R. (1991). Meta-analytic procedures for social research (Rev. ed.). Sage.
- Wilcoxon, F. (1945). Individual comparisons by ranking methods. Biometrics Bulletin, 1(6), 80–83.
Try it
One click opens the “Teaching-method study” sample dataset with this test selected and the variables filled in. Or use your own data.