Ask Mallard
Analysis method

Wilcoxon signed-rank test

5 min read

The Wilcoxon signed-rank test uses signs and ranks of paired differences to test symmetry about zero.

Fit

When to use it, and when not to

Use it when

  • You have two measurements per person, or prespecified matched pairs, and differences have meaningful magnitudes.
  • You want a paired rank test and can justify a symmetric distribution of differences.

Not when

Before you start

What you need

Decide these first
  1. Pair identifiers, differences and subtraction orderrepeatedMeasuresKeep pairs intact. Define after minus before, or its reverse.
  2. Zeros, tied magnitudes and measurement scaleState the zero-handling rule and whether the p-value is exact or approximate.
  3. The target population and missing-pair planExplain which pairs are incomplete. Justify a missing-data assumption, such as missing completely at random, and assess selection bias.
It rests on these
  1. Different pairs contribute independently.How to check: Repeated eyes, families or shared clinics require an approach that accounts for clustering.
  2. A location interpretation requires differences symmetric about a common center.How to check: Plot the differences themselves. Skew in either raw measurement alone does not decide the test.
  3. Absolute differences can be meaningfully ranked.How to check: A purely ordinal scale may not support subtracting scores or ranking the size of those differences.

Plain language

How it works

Compute one difference per pair. Remove zeros under the chosen rule, rank the remaining absolute differences and average tied ranks. Add ranks for positive differences. Under a symmetric zero-centered null, positive and negative signs balance. The calculator standardizes the positive-rank sum as a z score. A normal approximation or a suitable exact calculation supplies the p-value.

What the sources show

Li and Johnson distinguish symmetry testing from median testing under symmetry. Rosner and colleagues derive a clustered extension because ordinary paired ranks assume independent pairs. Neither result makes arbitrary skew or clustering harmless.

The method at a glance
Wilcoxon signed-rank test: Paired differences with a stated zero rule. Then Rank magnitudes and retain signs. Then Positive-rank sum tests zero-centered symmetry.Wilcoxon signed-rank testPaired differences with a stated zero ruleRank magnitudes and retain signsPositive-rank sum tests zero-centered symmetry
Conceptual diagram. It shows the structure of the idea, not data from any study.

Worked example

A worked example

Invented for illustration
Setting
A clinic measures change in 10 complete patient pairs.
Question
Are the differences compatible with symmetry about zero?
Approach
Differences: -2, 3, -1, 5, 4, -1, 6, 2, 0, 3. Use after minus before; drop zeros and average tied ranks.
Result
Dropping 1 zero leaves 9 pairs. Positive ranks sum to 38.5; z = 1.901. The approximate two-sided p = 0.057, without continuity correction.
What it means
This normal approximation is uncertain in a small sample. A large p-value proves neither symmetry nor no change; it estimates no mean effect.

In practice

Recent studies PubMed search · not vetted

Searching PubMed…

Watch out

Common mistakes

The one to remember

The signed-rank test needs symmetric differences for a location interpretation. It does not test the mean change, and ranks do not make clustering or missing pairs harmless.

  • Reporting the p-value as an estimate of mean change.Instead: Describe the differences and their clinical size. A location estimate and interval must match the chosen target and symmetry assumption.
  • Ignoring zeros or ties when describing the test.Instead: Report the zero rule, tie handling and probability calculation. Exact methods must accommodate the observed ties.

Inside Mallard

How Mallard uses this

Mallard links this article to its signed-rank calculator. It drops zeros and uses a tie-corrected normal approximation without continuity correction. The method registry links this method to its published analysis article and code.

Code example in Mallard: Wilcoxon signed-rank test with the Hodges-Lehmann pseudo-median change (wilcoxon-signed-rank-hodges-lehmann).
Calculators: Wilcoxon signed-rank (§2.6).
Atlas node analysis.wilcoxon_signed_rank, the id a plan cue records.

How to report it

Report the subtraction order, complete and nonzero pair counts, signed-rank statistic convention, zero and tie handling, and exact or approximate two-sided p-value. Describe the differences in their clinical units. For a symmetric location model, a Hodges-Lehmann estimate needs a signed-rank-inversion interval, not a mean-change interval. A reporting guideline is not a design manual: use it to make the study transparent, not as a substitute for careful design. Check the target journal's own requirements as well, which this page cannot know.

Code for this method
Loading…

Work it out

Related Learn pages

Related designs and methods

Evidence

Sources & further reading

  1. Wilcoxon's signed-rank statistic: what null hypothesis and why it matters (opens in a new tab) · Pharm Stat · doi 10.1002/pst.1628
  2. The Wilcoxon signed rank test for paired comparisons of clustered data (opens in a new tab) · Biometrics · doi 10.1111/j.1541-0420.2005.00389.x
Prepared with AI assistance. PubMed metadata matched by title, authors, year and DOI on 2026-11-07. Record verified, confirm it supports this use. No independent professional approval is claimed. Wilcoxon’s 1945 classic, Individual Comparisons by Ranking Methods, was not found in PubMed by exact-title search. No PMID is assigned to it.
Last source review: 2026-11-07
AI-generated educational content
Mallard uses reputable methodological and reporting sources, but this material may contain errors or omit important context. Verify important methodological decisions with the cited sources and, when appropriate, a qualified research methodologist or statistician.