- Introduced by
- Frank Wilcoxon
- Year
- 1945
- Type
- Nonparametric paired comparison
What does it do?
The Wilcoxon signed-rank test is a nonparametric method for comparing two related measurements taken on the same subjects, such as before and after an intervention.
It does not assume that the paired differences are normally distributed. It assumes that the differences are symmetric about their median; under that assumption it tests whether the median difference is zero. Frank Wilcoxon introduced it in 1945.
The intuition behind the method
When the same units are measured twice, the paired differences may be skewed or otherwise non-normal, which makes a t-test on their mean questionable. The signed-rank test ignores the raw size of each difference and instead ranks the absolute differences, reattaches the sign of each one, and compares the total rank carried by positive changes with the total carried by negative changes. If one direction clearly dominates the ranks, the median difference is unlikely to be zero. Because only ranks enter the calculation, the result does not depend on the exact magnitude of the largest changes, only on their position in the ordering.
History
Frank Wilcoxon introduced the signed-rank procedure in his 1945 Biometrics Bulletin paper on individual comparisons by ranking methods, which also covered the rank-sum test for independent samples. The signed-rank test became a standard distribution-free counterpart to the paired t-test.
When to use it
Choose this test when you have two related measurements on the same subjects (paired or repeated), the outcome is continuous or ordinal, and the paired differences are not plausibly normal. It assumes that the pairs are independent of one another and that the differences are distributed symmetrically about their median. If the differences are strongly skewed, the sign test is the safer choice. Do not use it for two independent groups, where the Mann-Whitney U test applies, or for more than two related conditions, where other repeated-measures rank methods are needed. With very few pairs the test has limited power, so a non-significant result is weak evidence of no difference. For small samples prefer exact p-values over the normal approximation.
Limitations and considerations
- Its interpretation as a comparison of medians rests on the symmetry of the difference distribution; under strong asymmetry the test answers a less clear question than the one it is built around.
- It compares exactly two related measurements; comparing three or more conditions requires a different design.
- With few pairs the attainable p-values are limited and power is low, so a non-significant result should not be read as evidence that the two measurements agree.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Does not assume the paired differences are normally distributed, which is the usual reason to choose it over the paired t-test.
- Accepts ordinal outcomes such as rating-scale scores, for which a difference in means is hard to interpret.
- Uses the ranks of the differences rather than only their signs, so it retains information about the size of the changes that the sign test discards, provided the symmetry assumption holds.
Applications
- Comparing a measurement taken before and after an intervention on the same participants when the change scores are non-normal.
- Analysing repeated measures on the same units when the outcome is ordinal, such as rating-scale scores.
- Analysing matched pairs in health, social and behavioral research where normality of the differences cannot be assumed.
How it works
How it works
The null hypothesis states that the paired differences are centred at zero, that is, their median is zero, so the two measurements have the same central tendency. The alternative states that this median differs from zero. The test is a comparison of medians only when the differences are symmetric about their median.
Formula
H_0:\ \text{median}(D) = 0 \quad H_1:\ \text{median}(D) \neq 0Each pair's difference D_i is computed. Pairs with a zero difference are conventionally dropped before ranking (Wilcoxon's original procedure); some software offers alternatives such as Pratt's method, which keeps them in the ranking. The absolute differences are ranked from smallest to largest, and tied absolute values receive their average rank. The original sign of each difference is then reattached. W⁺ is the sum of the ranks of the positive differences and W⁻ the sum of the ranks of the negative ones, and the test statistic W is the smaller of the two. For small samples the p-value can be obtained from the exact distribution of the statistic; for larger samples a normal approximation is used, ideally with a correction for ties. Which method is used, and the sample size at which a package switches between them, differs by software, so consult its documentation.
Formula
W = \min(W^+, W^-),\quad W^+ = \sum_{D_i > 0} R_i,\ \ W^- = \sum_{D_i < 0} R_i,\ \ R_i = \operatorname{rank}(|D_i|)Choose the significance level α before the analysis (0.05 is a common convention, not a property of the test) and reject the null hypothesis when the p-value is below it, indicating that the paired measurements differ. Alongside the verdict, the effect size r = Z / √N is commonly reported, where Z is the standardized test statistic and N is the number of pairs, so that the magnitude of the change is visible as well as its statistical significance.
Formula
\text{reject } H_0 \text{ if } p < \alpha;\quad r = \dfrac{Z}{\sqrt{N}}Common pitfalls
- Applying it to differences that are strongly skewed; in that case the sign test or another analysis is more appropriate.
- Handling zero differences and tied absolute differences without stating how they were treated, which changes the ranks and therefore the p-value.
- Using the normal approximation with very few pairs or many ties when an exact p-value is available.
- Reporting only the p-value; the effect size r = Z / √N shows how large the change is, which significance alone does not.
Frequently asked questions
How is this different from the paired t-test?
Both compare two related measurements on the same subjects, but the paired t-test assumes the differences are normally distributed and works on their mean, while the Wilcoxon signed-rank test ranks the differences and makes no normality assumption. Use the signed-rank test when the differences are non-normal or the outcome is ordinal.
When should I use the sign test instead?
The signed-rank test assumes the paired differences are distributed symmetrically about their median. When that assumption is doubtful, for example because the differences are strongly skewed, or when the sample is very small, the sign test is the safer choice because it uses only the direction of each change.
How many pairs do I need?
There is no single fixed minimum. With few pairs the test has limited power and its exact p-values take only a small set of values. For small samples use the exact p-value rather than the normal approximation; the sample size at which software switches to the approximation varies, so check its documentation.
How is the effect size reported?
A common effect size is r = Z / √N, where Z is the standardized test statistic and N is the number of pairs. Reporting it alongside the p-value conveys the magnitude of the change, not just its statistical significance.
Related methods
Sources
Wilcoxon, F. (1945). Individual comparisons by ranking methods. Biometrics Bulletin, 1(6), 80–83.
Open DOI reference