- The Wilcoxon signed-rank test compares two related (paired) measurements on the same subjects — it is the non-parametric alternative to the paired t-test, not a general-purpose non-parametric test.
- Use it when the differences between pairs are not normally distributed, or when your outcome is ordinal rather than truly continuous.
- The test ranks the absolute values of the differences, restores their sign, and compares the sum of positive versus negative ranks — it tests whether the median difference is zero.
- Always report the median difference and an effect size alongside the p-value — the p-value alone doesn't convey clinical magnitude.
- Zero differences are dropped before ranking, and tied ranks are averaged — both need to be understood before interpreting your output.
What Is the Wilcoxon Signed-Rank Test?
The Wilcoxon signed-rank test is a non-parametric statistical test that compares two related sets of measurements taken from the same subjects, testing whether the median of the differences between the pairs is equal to zero. It was developed by Frank Wilcoxon in 1945 as a rank-based counterpart to the paired t-test, for exactly the situations where the paired t-test's normality assumption doesn't hold.
Mechanically, the test takes the difference for each pair, ranks the absolute values of the non-zero differences from smallest to largest, then reattaches each rank's original sign (positive if the pair increased, negative if it decreased). It sums the positive ranks and the negative ranks separately — if there is truly no systematic difference between the paired measurements, these two sums should be roughly equal; a large imbalance between them is what produces a small p-value.
Instead of asking "is the average difference between before and after zero?" (the paired t-test's question), the Wilcoxon signed-rank test asks "is there a consistent direction to the differences, once we rank them by size?" — a question that doesn't require the differences to be normally distributed to answer validly.
When to Use the Wilcoxon Signed-Rank Test
The Wilcoxon signed-rank test is the correct choice whenever you have two related measurements per subject and at least one of the paired t-test's requirements isn't met. In practice, this means:
- Your outcome is measured twice on the same subjects (or on matched pairs), and you want to compare the two measurements.
- The differences between pairs are not normally distributed — confirmed formally with a Shapiro-Wilk test, or suspected from a small sample with visible skew or outliers.
- Your outcome is ordinal rather than continuous — a symptom severity scale, a Likert-type item, or a similar rank-only measurement.
- Your sample is too small to rely on the Central Limit Theorem to rescue a non-normal continuous outcome.
If your paired differences are approximately normally distributed and your outcome is genuinely continuous, the paired t-test remains the more statistically powerful choice — the Wilcoxon test is a fallback for when that assumption fails, not a universally "safer" default.
Suitable Data and Study Designs
The Wilcoxon signed-rank test fits a specific family of study designs — all built around the same subject (or matched pair) contributing two related data points.
| Study Design | Example |
|---|---|
| Pre-post (single-group) intervention | Symptom score before and after a 6-week therapy program |
| Crossover trial | Each patient receives both Drug A and Drug B, in random order, with a washout period |
| Matched-pair design | Each case matched to one control on age and sex, comparing a continuous biomarker |
| Repeated measurement, two time points | Pain score at admission and at discharge for the same patients |
It is not appropriate for comparing two independent, unrelated groups (use the Mann-Whitney U test instead), and not appropriate for more than two repeated measurements on the same subjects (use the Friedman test instead).
Wilcoxon Signed-Rank Test vs Paired T-Test
Both tests answer a similar practical question using paired data, but they differ in what they assume and what they actually compare.
| Feature | Paired T-Test | Wilcoxon Signed-Rank Test |
|---|---|---|
| Data type | Continuous | Continuous or ordinal |
| Distribution requirement | Differences approximately normal | No normality requirement |
| What is compared | Mean of the differences | Median of the differences (via ranks) |
| Sensitivity to outliers | High | Low — ranking limits their influence |
| Test statistic | t | W (or T, or Z for larger samples) |
| Typical effect size | Cohen's d | Matched-pairs rank-biserial r |
Assumptions and Requirements
The Wilcoxon signed-rank test has fewer and less restrictive assumptions than the paired t-test, which is exactly why it serves as its non-parametric fallback.
Paired or matched data
Each subject (or matched pair) contributes exactly two related measurements.
At least ordinal measurement
The differences must be capable of being ranked — meaningful order, not just categories.
Independence between pairs
One subject's pair of measurements shouldn't influence another subject's pair.
Roughly symmetric distribution of differences
Needed specifically for the "median difference" interpretation to be clean and meaningful — not required for the test's basic validity as a test of consistent direction.
Notice what's absent from this list: there is no requirement that the raw outcome values, or their differences, follow a normal distribution — this is the entire reason the test exists as an alternative to the paired t-test.
How to Prepare Your Paired Data
Correct data preparation prevents the most common data-entry errors that quietly invalidate a Wilcoxon analysis before the test is even run.
- Use wide format — one row per subject, with two columns (e.g., "Baseline" and "Follow-up") holding the paired measurements, not one long column with a grouping variable.
- Confirm correct pairing — double-check that each subject's baseline and follow-up values are on the same row and correspond to the same person; a single misaligned row silently corrupts every calculated difference.
- Handle missing data by exclusion — a pair missing either value must be excluded from the analysis (a complete-case pair is required); document how many pairs were excluded and why.
- Keep raw values, not pre-calculated differences only — StatClinic and most software calculate the difference internally, and keeping both raw columns lets you verify the calculation and report both conditions' medians separately.
A Realistic Medical Research Example
A physiotherapy clinic runs a 4-week exercise program for patients with chronic knee osteoarthritis and wants to know whether it reduces pain. Eighteen patients report their pain on a 0–100 Visual Analog Scale (VAS) at baseline and again after 4 weeks. A Shapiro-Wilk test on the paired differences returns p = 0.01, indicating the differences are not normally distributed — several patients improved dramatically while others showed almost no change, producing a skewed distribution unsuited to a paired t-test.
A partial view of the dataset for the first eight patients, showing how the ranking step works:
| Patient | Baseline VAS | Week 4 VAS | Difference | Rank of |Difference| | Signed Rank |
|---|---|---|---|---|---|
| 1 | 62 | 40 | -22 | 6 | -6 |
| 2 | 58 | 55 | -3 | 1 | -1 |
| 3 | 70 | 30 | -40 | 8 | -8 |
| 4 | 45 | 48 | +3 | 1.5 | +1.5 |
| 5 | 66 | 38 | -28 | 7 | -7 |
| 6 | 54 | 46 | -8 | 3 | -3 |
| 7 | 60 | 44 | -16 | 5 | -5 |
| 8 | 50 | 39 | -11 | 4 | -4 |
Absolute differences are ordered smallest to largest and assigned ranks 1, 2, 3... Patients 2 and 4 have the same absolute difference (3), so both receive the average of the two ranks they'd otherwise occupy (1 and 2, averaged to 1.5) — this is the tied-rank correction explained further below. Each rank then keeps the sign of its original difference.
Step-by-Step Analysis Using StatClinic
Running this analysis correctly — and being confident it's the right test — takes a few minutes with StatClinic's guided workflow.
Enter your paired data
Upload your dataset or enter it directly, with baseline and follow-up VAS scores as two separate columns for the same 18 patients.
Confirm your study design
Tell StatClinic these are paired / repeated measurements on the same subjects — this is what routes the analysis toward the correct family of tests.
Let StatClinic check normality automatically
StatClinic runs a Shapiro-Wilk test on the paired differences behind the scenes and flags when the paired t-test's assumption isn't met.
Accept the recommended test
StatClinic recommends the Wilcoxon signed-rank test once normality is flagged as violated — you can also select it manually if you already know it's the right test.
Review the full output
You'll get the test statistic, exact or asymptotic p-value, the median for each condition, the median difference, and the effect size r — all in one panel.
Get a ready-to-use interpretation
StatClinic generates a plain-language interpretation plus pre-written Methods and Results sentences you can adapt directly into your manuscript or thesis.
You can also run the calculation directly with the Wilcoxon Signed-Rank Test Calculator if you already have your ranked pairs and just need the statistic and p-value.
Interpretation: Test Statistic, P-Value, Medians, and Effect Size
For the osteoarthritis example (full sample of 18 patients), StatClinic's output might read: W = 9, Z = -3.34, p < .001, with a median VAS of 62 (IQR 54–70) at baseline falling to a median VAS of 38 (IQR 28–46) at 4 weeks, and an effect size r = 0.56. Here's how to read each piece:
| Output | What It Tells You |
|---|---|
| Test statistic (W / T / Z) | A summary of the rank imbalance between positive and negative differences — not interpretable in isolation; always reported alongside N and the p-value |
| P-value | The probability of seeing this much rank imbalance (or more) if there were truly no difference between conditions |
| Median (each condition) & median difference | The actual clinical quantity of interest — always report this alongside the p-value, never instead of it |
| Effect size (r) | Magnitude of the effect independent of sample size; roughly 0.1 small, 0.3 moderate, 0.5+ large |
Put together: the p-value tells you the pain reduction is very unlikely to be due to chance alone; the median drop from 62 to 38 tells you the reduction is clinically substantial; and r = 0.56 confirms the effect is large in magnitude, not just statistically detectable in a large sample.
Zero Differences and Tied Ranks: What to Do
Pairs With a Difference of Zero
Any pair where the two measurements are identical contributes a difference of zero, which cannot be meaningfully ranked as positive or negative — these pairs are dropped before ranking, and the effective sample size used by the test is reduced accordingly. If a large share of your pairs show no change at all, report that proportion explicitly; it may reflect a genuine ceiling or floor effect in your measurement tool (a scale unable to register further improvement) rather than a true absence of any effect.
Tied Ranks
When two or more pairs share the same absolute difference, each receives the average of the ranks they would otherwise occupy (as shown for patients 2 and 4 in the worked example above). A high number of ties reduces the accuracy of the standard normal approximation used for larger samples, so most statistical software — including StatClinic — automatically applies a tie-correction to the variance calculation, and defaults to an exact calculation method for small samples with few ties.
How to Report Results in a Thesis or Paper
A complete report states the test used, why it was chosen, the descriptive statistics for both conditions, and the full inferential result — following the same principles covered in our guide to writing statistical results by test.
"Because the distribution of paired differences in pre- and post-intervention pain scores was non-normal (Shapiro-Wilk p = 0.01), the Wilcoxon signed-rank test was used to compare baseline and 4-week VAS pain scores."
"Median VAS pain score decreased from 62 (IQR 54–70) at baseline to 38 (IQR 28–46) at 4 weeks (Wilcoxon signed-rank test, Z = -3.34, p < .001, r = 0.56), indicating a statistically significant and clinically meaningful reduction in pain following the exercise program."
Common Mistakes Researchers Make
Mistake 1: Using It for Independent Groups
Applying the Wilcoxon signed-rank test to two separate, unrelated groups of patients rather than paired measurements on the same subjects.
Mistake 2: Reporting Only the P-Value
Stating "p < .05" without reporting the median difference or an effect size, leaving readers unable to judge the actual clinical magnitude.
Mistake 3: Reporting a Mean With a Rank-Based Test
Presenting the arithmetic mean and standard deviation alongside a test that is actually based on ranks, creating an internal inconsistency.
Mistake 4: Ignoring a High Proportion of Zero Differences
Not mentioning that a substantial share of pairs showed no change, which silently reduces the effective sample size and power.
Mistake 5: Using It for More Than Two Time Points
Running repeated Wilcoxon tests across three or more time points instead of a single appropriate test, inflating the false-positive rate.
Mistake 6: Skipping the Normality Check Entirely
Defaulting to the Wilcoxon test out of caution without ever testing whether the paired t-test's assumption actually failed, losing statistical power unnecessarily.
"We used the Wilcoxon signed-rank test to compare pain scores between the treatment and control groups (p = 0.03)."
"Median VAS pain score decreased from 62 to 38 following treatment (Wilcoxon signed-rank test, Z = -3.34, p < .001, r = 0.56)" — the test is applied within one group across time, with full descriptive and effect-size reporting.
Frequently Asked Questions
Related Articles
Once your Wilcoxon test is run, these guides take you through the surrounding decisions:
Ready to Run Your Wilcoxon Test?
Let StatClinic's AI Statistical Assistant confirm the right test, run your analysis, and write your results sentence. Free, no registration required.
Try StatClinic Free →