What Is the Wilcoxon Signed-Rank Test?
The Wilcoxon signed-rank test is a nonparametric test for paired or matched observations. It ranks the absolute differences between paired measurements, restores the original signs, and compares the sum of positive signed ranks (W+) with the sum of negative signed ranks (W−). If the differences are symmetric and centered at the hypothesized location Δ₀, the two rank sums should be roughly equal. The test does not assume the paired differences are normally distributed — which is why it is often used when a paired t-test is not appropriate.
The usual location interpretation requires the paired differences to be roughly symmetric about their median. Without that symmetry, the test still describes a difference in location, but the specific parameter being tested is the pseudomedian (Hodges–Lehmann) rather than the median.
How to Use the Calculator
Enter paired data in one of two forms. Before / After pairs lets you paste two equal-length lists — the calculator computes the within-pair differences for you. Differences only takes the pre-computed differences directly. In both cases the pairing is preserved.
Set the hypothesized location Δ₀ (default 0), choose the alternative hypothesis (two-tailed, less, or greater), pick α from 10%, 5%, 1%, or a custom value, then select the method. Auto mode uses the exact test when feasible and falls back to the normal approximation otherwise. The continuity-correction toggle only affects the approximation.
Formula
Starting from paired observations, compute the differences:
dᵢ = Beforeᵢ − Afterᵢ − Δ₀
Then:
- Drop zero differences and record how many were dropped.
- Rank |dᵢ| from smallest to largest. Tied absolute differences receive the average of the ranks they would occupy.
- Restore the original signs to the ranks.
- Sum the positive signed ranks: W+.
- Sum the absolute values of the negative signed ranks: W−.
Under H₀ (symmetry about Δ₀), W+ and W− have the same distribution with mean n(n+1)/4 and variance n(n+1)(2n+1)/24, reduced by a tie correction when tied absolute differences are present. The reported test statistic is W = min(W+, W−). The p-value comes from the exact signed-rank distribution or from a normal approximation to W+.
The W Statistic
The notation W is not fully standardized. Some references use W for the smaller of the two rank sums, some for W+, and some for the signed sum. This calculator reports all three explicitly: W+ (positive rank sum), W− (negative rank sum), and W = min(W+, W−) as the primary test statistic. For one-tailed tests, the relevant tail uses W+ or W− as appropriate. When you compare results with other software, check which convention it reports.
Zero Differences and Tied Ranks
Zero differences carry no direction and are excluded from the signed-rank calculation under the usual convention. The effective sample size is n = number of non-zero pairs, not the total number of pairs. The calculator shows how many zeros were dropped so the reduction is visible. Including zeros by treating them as positive (or negative) changes the statistic and the p-value.
Tied absolute differences receive the average of the ranks they would otherwise occupy. Ties also change the variance of W+ under H₀, so a tie correction is subtracted from the variance before the normal approximation is used: the correction subtracts Σ(c³ − c)/48, where each c is the size of a group of identical absolute differences. Ties also prevent the exact method from being used, because the exact DP assumes distinct ranks.
Exact vs Normal Approximation
The exact method enumerates the signed-rank distribution under H₀ via dynamic programming and returns a p-value directly from that distribution. It is the correct choice for small samples with no tied absolute differences — typically n ≤ 25 in auto mode, or n ≤ 50 if you force exact. It does not compute a z statistic; the exact p-value is the answer.
The normal approximation uses the mean and tie-corrected variance of W+ under H₀ to produce a z statistic and an approximate p-value. It is the practical choice for larger samples or when ties are present. Auto mode selects exact when n is small and no ties exist, and falls back to the approximation otherwise. Whichever method runs, the calculator states which one was used — auto does not silently switch.
Continuity Correction
The signed-rank statistic is discrete — W+ can only take integer sums of ranks — but the normal approximation is continuous. The continuity correction shifts the numerator of the z statistic 0.5 toward zero before dividing by the standard deviation, which generally makes the approximation slightly more conservative. It only applies to the normal approximation. When the exact p-value is available, the correction has no effect.
P-Value and Decision
The p-value is the probability under H₀ of a test statistic at least as extreme as the observed one, in the direction of the selected alternative. For a two-tailed test, it is twice the smaller one-sided tail, capped at 1. For one-tailed tests, it is the appropriate single tail. Reject H₀ if p < α; do not reject otherwise. A small p-value is evidence against H₀ — it is not a measure of the size or practical importance of the effect.
Effect Size
The calculator reports a standardized effect size r = |z| / √n, where z is the normal-approximation statistic and n is the number of non-zero pairs. When the p-value is exact, no exact z exists — the calculator still reports an approximate z used only for the effect size, and the answer line labels it as approximate. Common rough benchmarks for r are around 0.1 (small), 0.3 (medium), and 0.5 (large), but the practical interpretation depends on the field and the study context.
Assumptions
- Paired observations. The test requires matched or dependent pairs, not two independent groups.
- Independence between pairs. Each pair is independent of the others.
- Rankable differences. The within-pair differences can be meaningfully ordered by magnitude.
- Symmetry of differences under H₀ for the usual median-location interpretation. If the differences are not symmetric, the test still runs, but the location parameter is the pseudomedian rather than the median.
- Normality is not required. This is the main reason the test is used over the paired t-test.
- Zero handling must be explicit. Different conventions exist; the calculator uses exclusion and reports the count.
vs Paired t-Test
The paired t-test operates on the mean of the paired differences and requires the differences to be approximately normally distributed for small samples. The Wilcoxon signed-rank test operates on the ranks of the absolute differences and does not require normality. The Wilcoxon is slightly less powerful than the t-test when the differences really are normal, but more robust to outliers and skew. Use the t-test when normality is reasonable and the mean is the parameter of interest; use the Wilcoxon otherwise.
vs Sign Test
The sign test uses only the direction of each non-zero difference and discards the magnitude. The Wilcoxon signed-rank test uses both direction and magnitude, through the ranks of the absolute differences. When the magnitudes carry useful information — which is usually the case — the signed-rank test has more power.
vs Mann–Whitney U / Wilcoxon Rank-Sum
They are different tests, not the same test under two names. The Wilcoxon signed-rank test is for paired or dependent observations. The Mann–Whitney U test (also called the Wilcoxon rank-sum test) is for two independent samples. Using one when the other is appropriate will produce wrong results because the underlying data structure is different.
Worked Example
Before: 120, 115, 130, 125, 118, 122, 128, 116. After: 125, 118, 128, 130, 122, 127, 131, 119. Differences (Before − After): −5, −3, 2, −5, −4, −5, −3, −3. No zeros, so n = 8.
Absolute differences are 5, 3, 2, 5, 4, 5, 3, 3 — both 3 and 5 appear three times, so ties are present and the exact method is unavailable. Ranks with average ties give W+ = 1 (only the positive difference has rank 1) and W− = 35. The reported statistic is W = 1. The tie-corrected variance reduces slightly from 51 to 50, giving a z statistic of approximately −2.33 with continuity correction, and a two-tailed p-value near 0.020 — significant at α = 0.05. The effect size r ≈ 0.82.
How to Report
A concise format: A Wilcoxon signed-rank test indicated that the paired differences were [significantly / not significantly] different from Δ₀, W = value, p = value, r = value. State which W is reported (min, W+, or W−) if you compare with other software. Report the exact or approximate method. Do not claim causation, superiority, or practical importance on the basis of the p-value alone.