Statistics & probability

Wilcoxon signed-rank calculator with zero differences

Calculate paired signed ranks with drop-zero or Pratt handling and exact conditional sign-flip inference.

Your numbers

Enter comma- or space-separated finite numbers. Values are limited to ±10¹²; missing observations are not silently removed. Enter differences directly, not two unaligned samples.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

The Wilcoxon signed-rank test combines the direction of paired changes with ranks of their magnitudes. Differences must be formed in one consistent direction, such as after minus before. Absolute differences are ranked, ties receive average ranks, and positive and negative rank sums are kept separately. This calculator enumerates the conditional distribution of nonzero signs through exact integer counting, allowing tied magnitudes without using a no-ties lookup table.

THE FORMULARank |d_i|; W+ sums positive-difference ranks and W− sums negative-difference ranks.

A worked example

For differences 0,1,−2,2, drop-zero ranking gives magnitudes 1,2,2 and ranks 1,2.5,2.5. Thus W+ = 3.5, W− = 2.5 and the displayed minimum is 2.5. Pratt ranking retains zero while creating ranks: the nonzero ranks become 2,3.5,3.5. The rank sums become 5.5 and 3.5. Both conventions have a two-sided sign-flip p-value of one for this example.

Good to know

Supports up to 100 differences. Exact conditional sign flips assume a symmetric difference distribution about zero under the null and independent pairs. Pratt and drop-zero conventions can change inference; choose intentionally. All-zero data return a clearly marked degenerate result. No z-split convention, asymptotic continuity correction or automatic measurement rounding is supplied.

Absolute ranks and signed sums are different steps

Rank the absolute values first, then attach the original signs. Ranking signed values directly would give a large negative difference a small rank and would destroy the intended weighting by magnitude. Reversing every difference must exchange W+ and W− without changing their minimum or the two-sided inference. That sign-reversal property is a useful way to check a manually prepared worksheet.

Zero differences contain no direction to flip. Drop-zero ranking removes them before assigning ranks, while Pratt ranking lets their magnitudes occupy rank positions before excluding their signs. The table lists the nonzero differences and their effective ranks. Its omission of zeros from the sign table does not mean Pratt forgot them: their influence is visible in the larger ranks assigned to nonzero observations.

Signed rank sums attach direction after ranking absolute differencesDrop zero; rank magnitudes firstW− = 2.5W+ = 3.5min(W+,W−) = 2.5
After dropping zero from (0,1,−2,2), ranks are 1,2.5,2.5. Positive ranks sum to 3.5 and the negative rank sum is 2.5; the statistic is the smaller sum.

The Mann–Whitney U test calculator with ties compares independent samples, rather than signed differences within matched pairs.

Symmetry matters more than simply avoiding a normal model

The signed-rank test is often described as nonparametric, but that does not remove its assumptions. Conditional fair sign flips are justified by symmetry about the null center. A strongly asymmetric change distribution may call for a different analysis. A sign test answers a different question because it ignores nonzero magnitudes; it should not be confused with a signed-rank calculation that happens to include many ties.

Compute differences at the precision meaningful for the measurements. Subtracting floating decimal readings can create tiny numerical inequalities between changes that should be tied. This page accepts the differences themselves so that such rounding is an explicit preparation choice. Keep the same subjects aligned, do not replace missing partners with zero, and report the chosen zero convention along with the statistic and p-value.

A few questions, answered

What if every difference is zero?

The conditional distribution has no nonzero sign evidence. The page returns W+=W−=0 and p=1 with an explicit degeneracy note; it does not claim equivalence.

Why can another package give a different p-value?

It may use an asymptotic normal method, a no-ties exact table, a different zero convention or another two-sided rule. Compare methods as well as sample values.

Find your calculator

Start typing to explore the library.