How to Use the Wilcoxon Signed-Rank Test Calculator

  1. 1. Choose the input mode: Before / After pairs if you have two matched lists — the calculator computes the within-pair differences for you. Differences only if the differences have already been computed. Either way, the pairing is preserved throughout.
  2. 2. Enter the paired data: Paste values separated by commas, spaces, or new lines. For Before / After mode, both lists must have the same length. Differences are calculated as Before − After, then the hypothesized location Δ₀ is subtracted. Zeros are dropped automatically and the count is reported.
  3. 3. Set the hypothesized location and alternative: Δ₀ is the location the paired differences are being tested against — 0 for a standard test of no difference, or a nonzero value if you have a specific reference. Choose two-tailed, less (H₁: location < Δ₀), or greater (H₁: location > Δ₀).
  4. 4. Choose the method and significance level: Auto selects exact when n is small and no tied absolute differences exist, and falls back to the normal approximation otherwise. Force exact or approx if you want to override. Set α from 10%, 5%, 1%, or a custom value. Continuity correction applies only to the approximation.
  5. 5. Review the signed-rank table: The table lists every pair with its difference, absolute difference, rank, and signed rank. Zero differences are shown as excluded. Ties appear as fractional ranks. This is the audit trail for the W+ and W− sums.
  6. 6. Read the result: The hero line shows W and, for the approximation, z and p. The stats panel reports W+, W−, W = min(W+, W−), z, p-value, method used, n (non-zero), zero count, effect size r, and the decision. The APA line summarises the result for reporting.
  7. 7. Check the method note: The method field states whether the exact or the normal approximation was used. Auto mode does not silently switch methods — it reports what actually ran. When the exact method is not available because of ties or sample size, the approximation runs instead and the exact p-value is not shown.

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:

  1. Drop zero differences and record how many were dropped.
  2. Rank |dᵢ| from smallest to largest. Tied absolute differences receive the average of the ranks they would occupy.
  3. Restore the original signs to the ranks.
  4. Sum the positive signed ranks: W+.
  5. 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.

Frequently Asked Questions

Q: What is the W statistic in the Wilcoxon signed-rank test?

The notation W is not fully standardized. It can refer to W+ (sum of positive signed ranks), W− (sum of negative signed ranks), or the smaller of the two. This calculator reports all three explicitly and uses W = min(W+, W−) as the primary test statistic. When comparing results with other software, check which convention it reports.

Q: What happens to zero differences?

A difference of zero has no direction and is excluded from the signed-rank calculation under the usual convention. The effective sample size n is the number of non-zero pairs, which can be smaller than the total number of pairs. The calculator shows how many zeros were dropped so the reduction is visible.

Q: How are tied ranks handled?

When multiple absolute differences have the same magnitude, they receive the average of the ranks they would otherwise occupy. Ties also affect the variance of W+ under H₀, so a tie correction is applied before using the normal approximation. Ties also prevent the exact method, which assumes distinct ranks.

Q: What is the difference between W+ and W−?

W+ is the sum of the ranks assigned to positive differences. W− is the sum of the absolute values of the ranks assigned to negative differences. Under the null hypothesis of symmetry, W+ and W− have the same distribution. The test statistic W = min(W+, W−) measures how far the observed data are from that symmetry.

Q: What is continuity correction in the Wilcoxon signed-rank test?

The signed-rank statistic is discrete, but the normal approximation is continuous. Continuity correction shifts the numerator of the z statistic by 0.5 toward zero before dividing by the standard deviation, which usually makes the approximation slightly more conservative. It only affects the normal approximation — when the exact p-value is available, no correction is needed.

Q: When should I use the exact method vs the normal approximation?

Use the exact method for small samples with no tied absolute differences — it calculates the p-value directly from the signed-rank distribution and does not rely on an approximation. Use the normal approximation for larger samples or when ties are present. Auto mode picks exact when n is small and no ties exist, and falls back to the approximation otherwise.

Q: What is the difference between the Wilcoxon signed-rank test and the sign test?

The sign test uses only whether each non-zero difference is positive or negative and discards the magnitude. The Wilcoxon signed-rank test uses both the direction and the ranked magnitude of the differences, so it has more power when the magnitudes carry useful information.

Q: Is the Wilcoxon signed-rank test the same as the Mann–Whitney U test?

No. 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 produces wrong results because the underlying data structure is different.

Q: What is the difference between the Wilcoxon signed-rank test and the paired t-test?

The paired t-test operates on the mean of the paired differences and assumes the differences are approximately normal for small samples. The Wilcoxon signed-rank test operates on the ranks of the absolute differences and does not require normality. The t-test is slightly more powerful when normality holds; the signed-rank test is more robust to outliers and skew.

Q: What assumptions does the Wilcoxon signed-rank test make?

Paired observations are required, pairs must be independent of each other, and the within-pair differences must be rankable by magnitude. For the usual median-location interpretation, the differences should be roughly symmetric about the hypothesized value. Normality is not required, but extreme outliers can still influence the ranks.

Q: What is the effect size for a Wilcoxon signed-rank test?

The calculator reports 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 for the effect size and labels it as such. Rough benchmarks for r: around 0.1 small, 0.3 medium, 0.5 large.

Q: Can the Wilcoxon signed-rank test be one-tailed?

Yes. The alternative hypothesis can specify that the paired differences are systematically greater than or less than Δ₀. A two-tailed test checks for a difference in either direction. Choose the alternative before examining the data — switching to a one-tailed test after seeing the results inflates the Type I error rate.

Q: Can the Wilcoxon signed-rank test be used for ordinal data?

It can be appropriate when paired ordinal measurements provide meaningful ordered differences — that is, when you can rank the magnitude of the within-pair differences. Whether it is suitable depends on how the ordinal scale is defined and whether the differences can be meaningfully ranked. If differences can only be classified as positive or negative, use the sign test instead.

Q: Does the Wilcoxon signed-rank test require normally distributed data?

No. The test does not require the paired differences to be normal. That is the main reason it is used over the paired t-test. However, the usual median-location interpretation assumes the differences are approximately symmetric, and independence between pairs is still required.

Q: How do I report a Wilcoxon signed-rank test?

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 being reported (min, W+, or W−), whether the exact or approximate method was used, and the number of non-zero pairs. Do not claim causation or practical importance on the basis of the p-value alone.

Loaded shared calculation