The Wilcoxon signed-rank test is the nonparametric alternative to the paired t-test. It also works as a one-sample test against a hypothesized median. It ranks the absolute differences and compares the positive and negative rank sums, so it copes with skewed differences and outliers. Exact p-values are used for up to 50 pairs without ties or zero differences.
When to use it
- Before-and-after or matched-pair data whose differences are not normally distributed.
- Ordinal outcomes such as ratings measured twice on the same people.
- One sample, to test whether its median equals a given value. Switch to the “One sample vs median” tab.
How it works
- Compute the difference for each pair and drop pairs with a difference of zero.
- Rank the absolute differences, giving tied values their average rank.
- Add the ranks of the positive differences (W⁺) and of the negative differences (W⁻).
- The test statistic W is the smaller of the two. Small values of W are evidence against H₀.
W⁺ + W⁻ = n(n + 1) ÷ 2 · z = (W⁺ − n(n + 1)/4) ÷ √[n(n + 1)(2n + 1)/24 − tie correction]
Reporting
Report W, the p-value, the number of non-zero pairs and an effect size such as r = |z| ÷ √n. For example: “A Wilcoxon signed-rank test showed no significant change, W = 18.0, p = .594, r = .18.” (These are the results for the example data.) Report the medians of both conditions too.
Frequently asked questions
What happens to zero differences?
Following Wilcoxon’s original method, pairs with no difference are removed before ranking, and the calculator tells you how many were dropped. If many pairs are tied at zero, consider whether the measurement is precise enough.
Is this the same as the Wilcoxon rank-sum test?
No. The rank-sum test is for two independent groups and is the same as the Mann-Whitney U test. The signed-rank test is for paired data.