Skip to main content
Stats for Scholars
Concepts Decision Tree Reporting Calculators Blog Software Cheat Sheets
Concepts Decision Tree Reporting Calculators Blog Software Cheat Sheets
Home Concepts Wilcoxon Signed-Rank Test

Descriptive Statistics

  • Descriptive Statistics

Inferential Statistics

  • Chi-Square Test of Independence
  • Independent Samples t-Test
  • Kruskal-Wallis H Test
  • Logistic Regression
  • Mann-Whitney U Test
  • Multiple Linear Regression
  • One-Way ANOVA
  • Paired Samples t-Test
  • Pearson Correlation
  • Repeated Measures ANOVA
  • Simple Linear Regression
  • Two-Way (Factorial) ANOVA
  • Wilcoxon Signed-Rank Test

Effect Size & Power

  • Effect Size
  • Sample Size Determination
  • Statistical Power & Power Analysis

Reliability & Validity

  • Cronbach's Alpha
  • Inter-Rater Reliability

Wilcoxon Signed-Rank Test

intermediate Inferential Statistics

Wilcoxon Signed-Rank Test

Purpose
Compares two related measurements to determine if there is a statistically significant difference when the paired t-test assumptions are not met.
When to Use
When you have two related measurements (pre/post, matched pairs) and the difference scores are ordinal or not normally distributed.
Data Type
Ordinal or continuous dependent variable measured twice on the same participants (or matched pairs)
Key Assumptions
The difference scores are independent across participants, symmetrically distributed around the median, and measured on at least an ordinal scale.
Tools
Effect Size Calculator on Subthesis →

What Is the Wilcoxon Signed-Rank Test?

The Wilcoxon signed-rank test is a non-parametric test for comparing two related measurements. It is the rank-based alternative to the paired samples t-test and does not require the difference scores to be normally distributed.

Like the paired t-test, this test works with difference scores — it calculates the difference between each pair of observations. But instead of using the raw differences, it ranks the absolute differences and then compares the sum of ranks for positive differences against the sum of ranks for negative differences.

The test is named after Frank Wilcoxon, who introduced it in 1945. It is one of the most widely used non-parametric methods in the biomedical and social sciences.

When to Use It

Use a Wilcoxon signed-rank test when:

  • The same participants are measured under two conditions or at two time points
  • The dependent variable is ordinal (e.g., pain ratings, Likert-scale responses)
  • The difference scores are not normally distributed (skewed, heavy-tailed, or contain outliers) and sample sizes are small
  • You have matched pairs where each observation in one condition corresponds to an observation in the other

Examples:

  • Pain ratings before and after a medical treatment
  • Quality-of-life scores before and after rehabilitation
  • Preference ratings for two products rated by the same consumers
  • Anxiety levels before and after a therapy session

When to use the paired t-test instead: If the difference scores are approximately normal (or your sample is large, n>30n > 30n>30), the paired t-test has greater statistical power.

Assumptions

  1. Dependent (paired) observations. Each participant provides two measurements, or participants are matched in pairs.

  2. Independence between pairs. While the two measurements within each pair are related, different pairs must be independent of each other.

  3. At least ordinal measurement. The differences must be rankable — you need to know which differences are larger than others.

  4. Symmetric distribution of differences. The distribution of Di=Xi,2−Xi,1D_i = X_{i,2} - X_{i,1}Di​=Xi,2​−Xi,1​ should be roughly symmetric around the median. This is a weaker assumption than normality but is required for the test to be valid. If the differences are highly asymmetric, consider the sign test instead.

Formula

Step 1: Calculate difference scores.

Di=Xi,post−Xi,preD_i = X_{i,\text{post}} - X_{i,\text{pre}} Di​=Xi,post​−Xi,pre​

Discard any pairs where Di=0D_i = 0Di​=0 (no change). Let nrn_rnr​ be the number of remaining pairs.

Step 2: Rank the absolute differences.

Rank ∣D1∣,∣D2∣,…,∣Dnr∣|D_1|, |D_2|, \ldots, |D_{n_r}|∣D1​∣,∣D2​∣,…,∣Dnr​​∣ from smallest to largest. Tied absolute values receive the average rank.

Step 3: Calculate signed rank sums.

W+=∑ranks of positive differencesW^+ = \sum \text{ranks of positive differences} W+=∑ranks of positive differences

W−=∑ranks of negative differencesW^- = \sum \text{ranks of negative differences} W−=∑ranks of negative differences

The test statistic is W=min⁡(W+,W−)W = \min(W^+, W^-)W=min(W+,W−).

Note: Some software reports W=W+W = W^+W=W+ (the sum of positive ranks). Check your output to know which convention is used.

Step 4: For large samples (nr>20n_r > 20nr​>20), use the normal approximation:

z=W+−nr(nr+1)4nr(nr+1)(2nr+1)24z = \frac{W^+ - \frac{n_r(n_r + 1)}{4}}{\sqrt{\frac{n_r(n_r + 1)(2n_r + 1)}{24}}} z=24nr​(nr​+1)(2nr​+1)​​W+−4nr​(nr​+1)​​

Effect size:

r=znr = \frac{z}{\sqrt{n}} r=n​z​

Where nnn is the total number of pairs (including zeros, depending on convention). Benchmarks: ∣r∣=.10|r| = .10∣r∣=.10 (small), .30.30.30 (medium), .50.50.50 (large).

Worked Example

Scenario: A physiotherapist measures pain ratings (0-10 scale) in 10 patients before and after a new stretching protocol.

| Patient | Before | After | DiD_iDi​ | ∣Di∣|D_i|∣Di​∣ | Rank of ∣Di∣|D_i|∣Di​∣ | Signed Rank | |:-------:|:------:|:-----:|:------:|:--------:|:----------------:|:-----------:| | 1 | 7 | 4 | -3 | 3 | 6.5 | -6.5 | | 2 | 5 | 5 | 0 | — | — | — | | 3 | 8 | 5 | -3 | 3 | 6.5 | -6.5 | | 4 | 6 | 4 | -2 | 2 | 4 | -4 | | 5 | 9 | 6 | -3 | 3 | 6.5 | -6.5 | | 6 | 4 | 3 | -1 | 1 | 1.5 | -1.5 | | 7 | 7 | 5 | -2 | 2 | 4 | -4 | | 8 | 8 | 7 | -1 | 1 | 1.5 | -1.5 | | 9 | 6 | 3 | -3 | 3 | 6.5 | -6.5 | | 10 | 5 | 3 | -2 | 2 | 4 | -4 |

Step 1: Calculate differences.

All differences are computed as After - Before. Patient 2 has D=0D = 0D=0 and is excluded. We have nr=9n_r = 9nr​=9 usable pairs.

Step 2: Rank the absolute differences.

  • ∣D∣=1|D| = 1∣D∣=1: Patients 6 and 8 share ranks 1-2; each gets rank 1.5
  • ∣D∣=2|D| = 2∣D∣=2: Patients 4, 7, and 10 share ranks 3-5; each gets rank 4
  • ∣D∣=3|D| = 3∣D∣=3: Patients 1, 3, 5, and 9 share ranks 6-9; each gets rank 7.5

Correction for the ranks of ∣D∣=3|D| = 3∣D∣=3: four values occupy positions 6, 7, 8, 9, so the average rank is (6+7+8+9)/4=7.5(6+7+8+9)/4 = 7.5(6+7+8+9)/4=7.5. Updating the table:

Patient Signed Rank
1 -7.5
3 -7.5
4 -4
5 -7.5
6 -1.5
7 -4
8 -1.5
9 -7.5
10 -4

Step 3: Calculate the signed rank sums.

W+=0(no positive differences)W^+ = 0 \quad \text{(no positive differences)} W+=0(no positive differences)

W−=7.5+7.5+4+7.5+1.5+4+1.5+7.5+4=45W^- = 7.5 + 7.5 + 4 + 7.5 + 1.5 + 4 + 1.5 + 7.5 + 4 = 45 W−=7.5+7.5+4+7.5+1.5+4+1.5+7.5+4=45

W=min⁡(0,45)=0W = \min(0, 45) = 0 W=min(0,45)=0

Step 4: Determine significance.

For nr=9n_r = 9nr​=9 at α=.05\alpha = .05α=.05 (two-tailed), the critical value of WWW from a Wilcoxon table is 5. Since W=0<5W = 0 < 5W=0<5, the result is statistically significant.

Using the normal approximation:

z=0−9×1049×10×1924=0−22.571.25=−22.58.44=−2.67z = \frac{0 - \frac{9 \times 10}{4}}{\sqrt{\frac{9 \times 10 \times 19}{24}}} = \frac{0 - 22.5}{\sqrt{71.25}} = \frac{-22.5}{8.44} = -2.67 z=249×10×19​​0−49×10​​=71.25​0−22.5​=8.44−22.5​=−2.67

This yields p≈.008p \approx .008p≈.008 (two-tailed).

Step 5: Calculate effect size.

r=∣−2.67∣10=2.673.16=0.84r = \frac{|{-2.67}|}{\sqrt{10}} = \frac{2.67}{3.16} = 0.84 r=10​∣−2.67∣​=3.162.67​=0.84

This is a large effect.

Interpretation

The Wilcoxon signed-rank test indicated that pain ratings were significantly lower after the stretching protocol (Mdn = 4) than before (Mdn = 6.5), W=0W = 0W=0, z=−2.67z = -2.67z=−2.67, p=.008p = .008p=.008, r=.84r = .84r=.84. All nine patients with a change reported reduced pain, and the large effect size indicates a substantial and consistent reduction.

What to consider:

  • A WWW of 0 (or close to it) means that virtually all differences point in the same direction — a very strong result.
  • Report medians rather than means when using non-parametric tests, because the test is based on ranks rather than raw values.
  • If the symmetry assumption is questionable, consider the simpler sign test, which only uses the direction of differences (positive vs. negative) without ranking their magnitudes.

Common Mistakes

  1. Using it when data are paired but the test should be the paired t-test. If difference scores are approximately normal and you have adequate sample size, the paired t-test is more powerful. Reserve the Wilcoxon for clear violations of normality.

  2. Including zero differences. Pairs with no change (D=0D = 0D=0) must be excluded before ranking. Failing to remove them inflates the sample size and distorts the test statistic.

  3. Ignoring the symmetry assumption. The Wilcoxon signed-rank test assumes the difference scores are symmetrically distributed. If differences are heavily skewed, the sign test is a safer alternative (though less powerful).

  4. Reporting means instead of medians. Since the Wilcoxon is rank-based, medians are the appropriate measure of central tendency to report alongside the test.

  5. Forgetting the effect size. Always compute r=z/nr = z / \sqrt{n}r=z/n​ or another appropriate effect size. The p-value alone does not convey the magnitude of the change.

  6. Confusing with the Wilcoxon rank-sum test. The signed-rank test is for paired data. The rank-sum test (Mann-Whitney U) is for independent groups. The names are similar, but the tests are fundamentally different.

How to Run It

```r # Wilcoxon signed-rank test in R wilcox.test(mydata$before, mydata$after, paired = TRUE, exact = FALSE)

Effect size

library(effectsize) rank_biserial(mydata$before, mydata$after, paired = TRUE)

```python from scipy import stats import pingouin as pg # Using scipy stat, p_value = stats.wilcoxon(before, after, alternative='two-sided') # Using pingouin result = pg.wilcoxon(before, after, alternative='two-sided') print(result) ```
  1. Go to Analyze > Nonparametric Tests > Legacy Dialogs > 2 Related Samples
  2. Select your two measurement variables (e.g., Before and After) and move them into the Test Pairs box
  3. Ensure Wilcoxon is checked under Test Type
  4. Click OK

SPSS reports the Z statistic and the asymptotic p-value (two-tailed). It also shows the number of negative ranks, positive ranks, and ties. Calculate the effect size manually as r = |Z| / √N.

Excel does not have a built-in Wilcoxon signed-rank test. To compute it manually:

  1. Calculate the difference for each pair in a new column
  2. Remove any rows where the difference is zero
  3. Take the absolute value of each difference
  4. Use RANK.AVG to rank the absolute differences
  5. Multiply each rank by the sign of the original difference (+1 or -1)
  6. Sum the positive signed ranks (W+) and the negative signed ranks (W-) separately
  7. Compare W = min(W+, W-) to a critical value table

Alternatively, install the Real Statistics Resource Pack add-in for an automated Wilcoxon signed-rank test.

## How to Report in APA Format > A Wilcoxon signed-rank test was conducted to evaluate the effect of a stretching protocol on patient pain ratings. Results indicated a statistically significant reduction in pain from pre-treatment (Mdn = 6.5) to post-treatment (Mdn = 4), $W$ = 0, $z$ = -2.67, $p$ = .008, $r$ = .84. The large effect size indicates that the stretching protocol produced a substantial and consistent decrease in pain ratings across patients.

Ready to calculate?

Now that you understand the concept, use the free Effect Size Calculator on Subthesis to run your own analysis.

Calculate Effect Size for Your t-Test on Subthesis

Related Concepts

Paired Samples t-Test

Learn how to conduct a paired samples t-test for pre/post designs and repeated measures, with formulas, worked examples, and APA reporting format.

Effect Size

Learn what effect size is, why it matters more than p-values alone, and how to calculate and interpret Cohen's d, Hedges' g, and eta-squared for your research.

Stats for Scholars

Statistics for Researchers, Not Statisticians

A Subthesis Resource

Learn

  • Statistical Concepts
  • Choose a Test
  • APA Reporting
  • Blog

Resources

  • Calculators
  • Cheat Sheets
  • About
  • FAQ
  • Accessibility
  • Privacy
  • Terms

© 2026 Angel Reyes / Subthesis. All rights reserved.

Privacy Policy Terms of Use