Statistics & Analysis

Wilcoxon Signed Rank Test

Reviewed byRemya Krishnan

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.[2][3] 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.

Explore the concept

Who takes the rank points

Follow 24 patients from before to after, then rank the sizes of their changes and see how the rank points split between rises and falls.

Music therapy, anxiety 0 to 100, illustrative patients

BeforeAfter62451000
Anxiety fell (19)Anxiety rose (5)Median

Before

62

median, IQR 48 to 74

After

45

median, IQR 32 to 58

Each line is one patient

The test works with each patient’s own change, after minus before. None of the 24 changes is zero and no two have the same size.

The big idea: The Wilcoxon signed rank test ranks the sizes of each pair’s difference, drops zeros, and compares the rank sum of the rises with that of the falls. It tests whether the differences are centered on zero, assuming they are roughly symmetric, so it speaks about the paired changes, not about the gap between two medians.

Figures are the article’s music therapy example: 24 patients, median anxiety 62 (IQR 48 to 74) before and 45 (IQR 32 to 58) after, no zero or tied differences, W = 35, Z = 3.29, p = 0.001 by the normal approximation (exact 0.0005), r = 3.29 ÷ √24 = 0.67. Under no change W has mean 24 × 25 ÷ 4 = 150 and standard deviation √(24 × 25 × 49 ÷ 24) = 35, so the falls hold 300 − 35 = 265. The 24 patients’ values are illustrative, built to have no zero or tied differences, W = 35 (19 falls and 5 rises, of 1, 3, 6, 11 and 15 points) and the reported medians and IQRs; their median difference, a drop of 11 points, is specific to this illustration. The shaded band spans 150 ± 35 and ± 70 (80 to 220).

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.[3] This is Wilcoxon's original rule; Pratt's variant keeps zeros in the ranking, and some software offers it as an option.[3][4] The absolute values of the remaining differences are ranked from smallest to largest, with tied ranks receiving the average rank.[3] 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.[3] 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, including Field's, divide by the total number of observations (twice the number of pairs) instead, which gives a smaller r, so state which was used.[1]

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.[3] 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.[1]
  • 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.

Test your understanding

5 questions that adapt as you go: answer two in a row correctly and they get harder.

Question 1 of 5

Scenario:

Two papers analyze the same 24 paired differences and both report Z = 3.29. One gives an effect size of r = 0.67, the other r = 0.47.

Question:

Why do the two effect sizes differ?

Hardness: Interpret

Sources

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

Cite this term

FullPaperguide. (2026, October 16). Wilcoxon Signed Rank Test. In Paperguide Research Glossary. https://paperguide.ai/research-glossary/wilcoxon-signed-rank-test/
In-text(Paperguide, 2026)

Related terms