Statistics & Analysis

Wilcoxon Signed Rank Test

Definition

The Wilcoxon signed rank test is a nonparametric statistical test used to compare two related samples or matched pairs when the assumption of normality required by the paired samples t test is not met. The test evaluates whether the distribution of the paired differences is centered on zero, assuming that distribution is symmetric; under that assumption, it tests whether the median difference is zero. Rather than operating on the raw values, the test ranks the absolute values of the differences between pairs and then compares the sum of positive ranks to the sum of negative ranks. It is the nonparametric counterpart to the paired samples t test and is appropriate for ordinal data or continuous data with non normal distributions, severe outliers, or small sample sizes where the central limit theorem does not provide adequate protection.

Why it matters

Many research situations involve paired or repeated measures data that do not meet the normality assumptions required by parametric tests. Pain scores measured before and after treatment, Likert scale ratings from the same participants under two conditions, and physiological measurements from matched case control pairs often produce skewed or ordinal data for which mean differences and t tests are inappropriate. The Wilcoxon signed rank test provides a valid inferential tool for these situations, testing hypotheses about the center of the differences without assuming that they are normally distributed (though it does assume that they are symmetric). Its widespread availability in statistical software, interpretability, and robustness make it one of the most commonly used nonparametric tests in clinical and social research.

How it works

The test begins by calculating the difference between each pair of observations. Pairs with a difference of exactly zero are discarded. This is Wilcoxon's original rule; Pratt's variant keeps zeros in the ranking, and some software offers it as an option. The absolute values of the remaining differences are ranked from smallest to largest, with tied ranks receiving the average rank. Each rank is then assigned the sign (positive or negative) of the original difference. The test statistic W is calculated as the sum of the positive ranks (or equivalently, the sum of the negative ranks, depending on the software implementation). Under the null hypothesis that the differences are symmetric about zero, the sum of the positive ranks and the sum of the negative ranks should be similar, each close to n(n + 1)/4. The significance of the observed W is determined by comparing it to the exact sampling distribution (for small samples) or to a normal approximation (for larger samples, typically n greater than 20). The effect size can be reported as r = Z / square root of n, where Z is the standardized test statistic and n is the number of non zero differences; some texts divide by the total number of observations (twice the number of pairs) instead, which gives a smaller r, so state which was used.

When to use it

Use the Wilcoxon signed rank test when comparing two measurements from the same participants (repeated measures) or from matched pairs, when the difference scores are not normally distributed, when the data are ordinal, or when the sample size is too small to rely on the robustness of the paired t test. Common applications include pre and post treatment comparisons on non normal outcomes, preference studies where participants rate two alternatives, and matched case control studies with ordinal endpoints. The test assumes that the distribution of difference scores is symmetric around its median; when the differences are skewed, a significant result can reflect that asymmetry rather than a shift in the median difference. For data that are clearly asymmetric, the sign test (which uses only the direction of differences, not their magnitude) may be more appropriate. The sign test also suits purely ordinal scores, where ranking the differences assumes that a 2 point change means more than a 1 point change at every point of the scale.

Key takeaways

  • Many research situations involve paired or repeated measures data that do not meet the normality assumptions required by parametric tests.
  • Pairs with a difference of exactly zero are discarded.
  • Use the Wilcoxon signed rank test when comparing two measurements from the same participants (repeated measures) or from matched pairs, when the difference scores are not normally distributed, when the data are ordinal, or when the sample size is too small to rely on the robustness of the paired t test.
  • A frequent mistake is using the Wilcoxon signed rank test on independent samples, confusing it with the Wilcoxon rank sum test (Mann Whitney U test), which is designed for two independent groups.

Common mistakes

A frequent mistake is using the Wilcoxon signed rank test on independent samples, confusing it with the Wilcoxon rank sum test (Mann Whitney U test), which is designed for two independent groups. Another error is applying the test without checking the assumption that the distribution of differences is approximately symmetric, which can affect the validity of the test. A related error is reporting a significant result as a difference between the two medians: the test concerns the paired differences, and the median of the differences is generally not the same as the difference between the before and after medians. Researchers sometimes report only the p value without an effect size measure, making it difficult to assess the practical significance of the finding. Failing to report the number of zero differences and tied ranks, which affect the test statistic calculation, reduces the transparency of the analysis. Using the test unnecessarily when the paired t test assumptions are met wastes statistical power, as parametric tests are generally more powerful than their nonparametric counterparts when distributional assumptions hold.

Example

A study evaluates whether a single session of music therapy reduces anxiety in 24 surgical patients. Anxiety is measured using a visual analog scale (0 to 100) before and after the session. The Shapiro Wilk test indicates that the distribution of difference scores is significantly non normal (p = 0.008): it has heavy tails, with a few very large changes, but is roughly symmetric, so the signed rank test's symmetry assumption is plausible. A Wilcoxon signed rank test is used instead of a paired t test. The median anxiety score decreases from 62 (IQR: 48 to 74) before therapy to 45 (IQR: 32 to 58) after therapy. The gap between these two medians, 17 points, is not the same thing as the median of the 24 paired differences, which is worth reporting as well. None of the 24 differences is zero, and no two have the same size. The sum of the positive ranks (the patients whose anxiety rose) is W = 35, giving Z = 3.29 and p = 0.001 by the normal approximation (the exact p is 0.0005), with an effect size of r = 3.29 ÷ √24 = 0.67, a large effect by Cohen's benchmarks. The researchers conclude that anxiety scores fell significantly after the session; because the study has no control group, the fall cannot be attributed to music therapy alone, since anxiety might also have eased with time or attention.

Sources

  1. [1]Field A. Discovering Statistics Using IBM SPSS Statistics. 6th ed. SAGE Publications, 2024.
  2. [2]Wilcoxon F. Individual comparisons by ranking methods. Biometrics Bulletin. 1945;1(6):80-83.
  3. [3]Hollander M, Wolfe DA, Chicken E. Nonparametric Statistical Methods. 3rd ed. Wiley, 2014.
  4. [4]Pratt JW. Remarks on zeros and ties in the Wilcoxon signed rank procedures. J Am Stat Assoc. 1959;54(287):655-667.

Cite this term

FullWilcoxon Signed Rank Test. Paperguide Research Glossary. Paperguide, 2026. Available at: https://paperguide.ai/research-glossary/wilcoxon-signed-rank-test/
In-text(Paperguide, 2026)

Related terms