Wilcoxon Signed-Rank Test Calculator

Non-parametric paired test.

Enter at least 3 values for Before data

Examples:

Enter paired data to perform Wilcoxon signed-rank test

What Is the Wilcoxon Signed-Rank Test?

The Wilcoxon signed-rank test compares two related measurements (paired data) when normality cannot be assumed. It's the non-parametric alternative to the paired t-test.

Question answered: "Is there a systematic difference between paired measurements?"

Examples:

  • "Did patients improve after treatment?" (before-after on same patients)
  • "Do people rate Product A higher than Product B?" (same people rating both)
  • "Are Monday measurements different from Friday?" (same subjects both days)

Why Signed-Rank?

The test uses both:

Sign: Direction of change (positive or negative) Rank: Magnitude of change (how big)

This makes it more powerful than the sign test (which ignores magnitude) while remaining robust to non-normality.

How It Works

Step 1: Calculate Differences

SubjectBeforeAfterDifference
18275-7
27880+2
39182-9
485850
57670-6
68879-9

Step 2: Exclude Zero Differences

Subject 4 has difference = 0. Exclude from analysis.

n = 5 (remaining subjects)

Step 3: Rank Absolute Differences

| Subject | Difference | |Difference| | Rank | |---------|------------|--------------|------| | 2 | +2 | 2 | 1 | | 5 | -6 | 6 | 2 | | 1 | -7 | 7 | 3 | | 3 | -9 | 9 | 4.5 | | 6 | -9 | 9 | 4.5 |

Tied values (both 9) get average rank (4+5)/2 = 4.5.

Step 4: Sum Positive and Negative Ranks

W⁺ = 1 (sum of ranks for positive differences) W⁻ = 2 + 3 + 4.5 + 4.5 = 14 (sum of ranks for negative differences)

Step 5: Calculate Test Statistic

W = min(W⁺, W⁻) = 1

Step 6: Determine P-Value

Compare W to critical values for n = 5, or use normal approximation for larger samples.

For n = 5, W = 1: p ≈ 0.063 (two-tailed)

Conclusion: Borderline evidence that after-values are lower (p = 0.063).

Alternative Formulations

Different software may report:

W (as above): Minimum of W⁺ and W⁻ T: Same as W (different notation) V: Sum of positive ranks only (W⁺) z: Normal approximation statistic

All lead to the same p-value.

Normal Approximation

For n > 25 (some say n > 10):

z=W−μWσWz = \frac{W - \mu_W}{\sigma_W}

Where:

  • μW=n(n+1)4\mu_W = \frac{n(n+1)}{4}
  • σW=n(n+1)(2n+1)24\sigma_W = \sqrt{\frac{n(n+1)(2n+1)}{24}}

With tie correction:

σW=n(n+1)(2n+1)24−∑t(t2−1)48\sigma_W = \sqrt{\frac{n(n+1)(2n+1)}{24} - \frac{\sum t(t^2-1)}{48}}

where t = number of ties at each rank.

Handling Ties

Ties in differences (zeros): Exclude from analysis. Some methods include them with special handling.

Ties in absolute differences: Assign average ranks (as shown in example).

Apply tie correction to standard error.

Example: Treatment Effect

Scenario: Pain scores (0-10) before and after therapy for 12 patients.

| Patient | Before | After | Diff | |Diff| | Rank | Signed Rank | |---------|--------|-------|------|--------|------|-------------| | 1 | 7 | 4 | -3 | 3 | 5.5 | -5.5 | | 2 | 8 | 6 | -2 | 2 | 3 | -3 | | 3 | 5 | 6 | +1 | 1 | 1.5 | +1.5 | | 4 | 9 | 5 | -4 | 4 | 8.5 | -8.5 | | 5 | 6 | 5 | -1 | 1 | 1.5 | -1.5 | | 6 | 8 | 3 | -5 | 5 | 10.5 | -10.5 | | 7 | 7 | 7 | 0 | - | - | (excluded) | | 8 | 9 | 6 | -3 | 3 | 5.5 | -5.5 | | 9 | 6 | 4 | -2 | 2 | 3 | -3 | | 10 | 8 | 7 | -1 | 1 | 1.5 | -1.5 | | 11 | 7 | 3 | -4 | 4 | 8.5 | -8.5 | | 12 | 8 | 3 | -5 | 5 | 10.5 | -10.5 |

n = 11 (excluding patient 7)

W⁺ = 1.5 W⁻ = 5.5 + 3 + 8.5 + 1.5 + 10.5 + 5.5 + 3 + 1.5 + 8.5 + 10.5 = 58.5

W = 1.5

P-value: p < 0.01

Conclusion: Significant reduction in pain after therapy.

Effect Size

Matched-pairs rank-biserial correlation:

r=1−4Wn(n+1)r = 1 - \frac{4W}{n(n+1)}

Or: r=W+−W−n(n+1)/2r = \frac{W^+ - W^-}{n(n+1)/2}

rInterpretation
0.1Small
0.3Medium
0.5Large

When to Use Wilcoxon Signed-Rank

Appropriate

  • Paired/matched data
  • Non-normal difference distribution
  • Ordinal data
  • Small samples with unknown distribution
  • Data with outliers

Not Appropriate

  • Independent groups (use Mann-Whitney)
  • More than two conditions (use Friedman test)
  • Continuous outcome when normality holds (paired t-test more powerful)

Comparison with Paired T-Test

AspectPaired T-TestWilcoxon Signed-Rank
AssumptionNormal differencesNone (uses ranks)
Data typeContinuousContinuous or ordinal
TestsMean differenceSymmetric distribution around 0
Power (normal)Higher~95% of t-test
Power (non-normal)May be invalidValid
OutliersSensitiveRobust

Comparison with Sign Test

AspectSign TestWilcoxon Signed-Rank
Information usedDirection onlyDirection + magnitude
PowerLowerHigher
AssumptionsContinuous, independentSymmetric differences
Best forOrdinal, many tiesContinuous, rankable

Applications

Medical Research

  • Pre-post treatment comparisons
  • Crossover trials
  • Self-control studies

Psychology

  • Within-subject experiments
  • Test-retest comparisons
  • Intervention effects

Quality Control

  • Before-after process changes
  • Paired measurements from different instruments

Consumer Research

  • Paired preference tests
  • Rating comparisons for same respondents

Assumptions

Paired Data

Each observation in one condition is matched with specific observation in the other.

Independence of Pairs

Different pairs are independent (one subject's difference doesn't affect another's).

Continuous and Symmetric Differences

The difference distribution should be symmetric around its median.

Note: Less strict than normality requirement of paired t-test.

Ordinal Scale (Minimum)

Differences can be meaningfully ranked.

Common Mistakes

Using for Independent Groups

Wilcoxon signed-rank is for paired data. Use Mann-Whitney for independent groups.

Not Excluding Zeros

Zero differences should be excluded (or handled specially).

Confusing with Wilcoxon Rank-Sum

"Wilcoxon signed-rank" = paired data "Wilcoxon rank-sum" = independent groups (= Mann-Whitney)

Ignoring Symmetry Assumption

With highly asymmetric differences, interpretation is complicated.

Reporting Results

APA format:

"A Wilcoxon signed-rank test indicated that pain scores were significantly lower after therapy (Mdn = 4.5) than before (Mdn = 7.5), W = 1.5, p < .01, r = .73."

Include:

  • W statistic (or z if using approximation)
  • P-value
  • Medians for both conditions
  • Effect size

Historical Context

Frank Wilcoxon introduced this test in 1945, along with the rank-sum test for independent samples.

These rank-based methods provided alternatives to t-tests when normality couldn't be assumed—addressing a real need in applied research where data are often skewed.

Wilcoxon's approach of using ranks to create distribution-free tests was revolutionary and spawned an entire field of non-parametric statistics.

One-Sample Application

The test can compare a single sample to a hypothesized median:

  1. Calculate differences from hypothesized value
  2. Apply signed-rank procedure

This is the non-parametric alternative to the one-sample t-test.

Related Calculations

Summary

The Wilcoxon signed-rank test compares paired measurements by analyzing the signs and ranks of differences. It's the non-parametric alternative to the paired t-test, appropriate when differences aren't normally distributed. Calculate differences, rank their absolute values, sum positive and negative ranks separately, and use the smaller sum as the test statistic. The test assumes symmetric differences and independent pairs. Report W, p-value, medians, and effect size. Use when normality is doubtful or data are ordinal, but note the paired t-test is more powerful when normality holds.