AI Glossary / Statistics and probability / Intermediate

Wilcoxon signed-rank test

Definition

The Wilcoxon signed-rank test evaluates paired differences using the ranks of their absolute sizes together with their signs. In its usual formulation, it tests whether the difference distribution is symmetric about zero. It is often used for matched or before-and-after measurements when a rank-based alternative to the paired t-test is appropriate.

What it means

Pairing is central. The comparison concerns the change within each person, object or matched pair, rather than two unrelated collections of observations. By ranking absolute differences, the test uses information about which changes are larger without using their raw magnitudes directly as a mean-based test would.

It is not an assumption-free test of “any difference.” Independence across pairs and an appropriate symmetry interpretation matter. Under a symmetric location-shift model, it can be interpreted as testing whether the center of the differences is zero. Without that context, describing it simply as a universal test of medians can mislead.

How it works

Define each paired difference in a consistent direction. Under the conventional zero-discarding approach, remove zero differences, rank the absolute nonzero differences, and attach each original sign to its rank. Sum positive ranks and negative ranks separately. One common two-sided statistic is the smaller of these sums.

For distinct nonzero absolute differences, an exact reference distribution comes from the possible sign assignments under the symmetric null. Larger samples may use an approximation. Ties and zeros require appropriate conventions and affect the reference calculation. Record the alternative hypothesis, difference direction, zero treatment and p-value method rather than reporting an unexplained number.

Three practical examples

1. Workflow evaluation: A team measures the same employees' task times under two tools. It analyses paired differences, while accounting for order and practice effects in the study design rather than expecting the test to remove them.

2. Device comparison: Engineers measure each test item with two sensors. Signed ranks can assess a location difference in paired readings, alongside agreement plots and an evaluation of whether discrepancies matter operationally.

3. Learning activities: A course organizer compares participants' before-and-after scores. A rank-based test may support a descriptive evaluation, but a simple before-and-after design alone does not establish that the course caused the changes.

Think of it this way

Think of arranging changes from smallest to largest, then placing each rank on the improvement or decline side of a balance. The test asks whether that rank balance is unusually one-sided. It does not weigh changes by their exact original size, and it still needs a sensible reason to treat the signs as comparable under the null.

Worked example

Consider six original paired differences, defined as after minus before: −1, 2, 3, 4, 5 and 6 score units. All absolute differences are distinct and nonzero, so their ranks are 1 through 6. The negative-rank sum is 1, and the positive-rank sum is 2 + 3 + 4 + 5 + 6 = 20. The smaller rank sum is therefore 1.

Under the standard symmetric sign-assignment null, the 2⁶ = 64 sign patterns are equally likely conditional on these magnitudes. Two patterns give a positive-rank sum at most 1: no positive ranks, or only rank 1 positive. Two more give a sum at least 20. Thus the conventional exact two-sided p-value is 4/64 = 0.0625.

At a prespecified 5% level, this does not reject the null. It does not prove no change occurred. A one-sided question would have a different tail calculation and must not be selected retrospectively merely to obtain a smaller p-value.

Illustrative case study

In this fictional case, Moss Studio tests an AI-assisted editing workflow with the same volunteers using both versions. The analyst records completion times and checks the paired differences. Several ties occur because times were rounded to whole minutes.

The team uses a method that handles those ties and reports its settings. It also presents the differences in minutes and reviews whether the study's order assignment could have produced practice effects. The final assessment separates the rank-test result from practical time savings and from the stronger causal claims that the design may or may not support.

Common misconceptions and mistakes

Do not confuse the signed-rank test with the Wilcoxon rank-sum or Mann - Whitney test for independent groups. Nor is it identical to the sign test, which uses direction without ranking the absolute differences.

Ranks reduce dependence on exact magnitudes but do not eliminate assumptions. Strongly asymmetric differences complicate a median-shift interpretation. Repeated measurements from the same individual should not be treated as independent pairs without accounting for dependence. Software labeled “exact” may have limitations when ties or zeros occur. Floating-point subtraction can also create artificial distinctions between differences intended to be equal.

Business use

The test can support small paired comparisons in usability, quality evaluation and operational experiments. Its value lies in using the pairing and a clearly stated statistical target, not in producing a convenient significance result when another method is unfavorable.

Report sample size, the distribution of paired differences, practical effect summaries and uncertainty where available. Preserve the pairing identifiers during data preparation. Losing the matching and then applying a signed-rank test to arbitrary row order can change the question entirely while still producing a plausible-looking output.

People also ask

Does it compare two independent groups?

No. Use a method designed for independent samples when observations are not paired.

Does it require normally distributed differences?

No, but the usual location interpretation relies on symmetry and other assumptions.

Can zero differences simply be ignored without explanation?

One conventional method discards them, but other treatments exist. State the chosen convention because it affects the calculation.

Check your understanding

Why does the example's negative side receive rank one?

Answer: The only negative difference has the smallest absolute magnitude.

Does p = 0.0625 mean a 6.25% probability that no change exists?

Answer: No. It is a tail probability for the statistic under the specified null model.

Would changing the subtraction direction alter the two-sided evidence?

Answer: It swaps the positive and negative rank sums, leaving this two-sided calculation unchanged.

Related terms

  • Rank
  • Sign test
  • Exact test
  • Paired samples
  • rank-sum test
  • symmetry
  • location shift
  • ties

Learn next

Next, compare the signed-rank, paired t and sign tests on a small set of paired differences. Examine what each method targets. Then explore tie handling, effect estimation and study designs that separate treatment changes from order or time effects.

  • Rank

More in Statistics and probability

  • Wide model - A wide model is a linear model with many input features, often represented sparsely, that connect directly to an output score.
  • Widely applicable information criterion - The widely applicable information criterion, or WAIC, estimates a Bayesian model's out-of-sample predictive performance using pointwise likelihood values...
  • Wike's law of low odd primes - Wike's law of low odd primes is a deliberately provocative experimental-design maxim associated with a 1973 article by Edward L. Wike.
  • Wilks' theorem - Wilks' theorem states that, under suitable regularity conditions and a true null hypothesis, twice the difference between maximized log likelihoods of...
  • Win statistics - Win statistics are measures that summarize pairwise comparisons between two groups as wins, losses and ties under a specified outcome rule.
  • Winsorized samples - Winsorized samples are datasets in which selected extreme observations have been replaced by specified boundary values.

Sources

SciPy's wilcoxon documentation specifies the paired-difference null, statistic, zero conventions and limitations of exact calculations with ties: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.wilcoxon.html

The six-pair calculation was independently checked by enumerating all 64 sign patterns. The Moss Studio case is fictional; its outcome is not evidence about any particular AI tool.

Previous: Wikification Next: Wilks' theorem

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer