
The Wilcoxon Signed Rank Test is a non-parametric statistical method used to compare two related groups or assess whether a single group differs significantly from a known reference value. It serves as a robust alternative to the paired sample t-test when data violates the assumption of normality — making it especially valuable when working with small samples, ordinal data, or distributions that are skewed or contain outliers.
Developed by Frank Wilcoxon in 1945, the test works by ranking the absolute differences between paired observations and then evaluating the direction of those differences. Rather than relying on raw data values, it uses the relative magnitude of changes, which makes it more resistant to the influence of extreme scores.
Researchers across psychology, medicine, and the social sciences routinely apply this test when parametric assumptions cannot be met, offering a reliable path to meaningful conclusions without sacrificing statistical rigor.
Your data are paired or repeated measures
The test is designed for situations where each observation in one group corresponds directly to an observation in another — such as pre- and post-treatment measurements taken from the same participants, or matched pairs in a controlled study. If your data are independent rather than paired, a different non-parametric test, such as the Mann-Whitney U Test, is more appropriate.
The assumption of normality is violated
The paired sample t-test requires that the differences between pairs are approximately normally distributed. When this assumption fails — confirmed through tests such as the Shapiro-Wilk test or visual inspection of a Q-Q plot — the Wilcoxon Signed Rank Test provides a dependable alternative that makes no such distributional requirement.
Your sample size is small
With smaller samples, the central limit theorem cannot reliably normalise the sampling distribution, making parametric tests less trustworthy. The Wilcoxon Signed Rank Test remains valid regardless of sample size, though very small samples (n < 5) may lack sufficient statistical power to detect a real effect.
Your data are ordinal
When measurements represent ranked categories rather than true numeric quantities — such as Likert scale responses, pain severity ratings, or satisfaction scores — means and standard deviations carry limited meaning. The Wilcoxon Signed Rank Test operates on ranks rather than raw values, making it well-suited to ordinal data.
Outliers are present
Extreme values can distort the results of parametric tests by inflating the mean and variance. Because the Wilcoxon Signed Rank Test ranks differences rather than analysing their raw magnitude, it is far less sensitive to outliers and provides more stable estimates when anomalous data points are present.
When Not to Use It
The Wilcoxon Signed Rank Test is not appropriate in every situation. Avoid it when your data are independent rather than paired, when you have a nominal outcome variable (use chi-square instead), or when your sample is large and normality holds — in those cases, the paired t-test is both valid and more statistically powerful. Additionally, the test assumes that the differences between pairs are symmetrically distributed; if this condition is severely violated, alternatives such as the sign test may be preferable.
The data are paired
Each observation must have a corresponding partner — whether from the same participant measured at two time points, or from two matched individuals in a controlled design. The test is built around the differences between these pairs, so an unpaired structure renders it inappropriate.
The dependent variable is continuous or ordinal
The outcome being measured must be at least ordinal in scale, meaning values can be meaningfully ranked. Nominal variables — such as categories with no inherent order — cannot be ranked and therefore cannot be analysed using this test.
The differences between pairs are symmetrically distributed
This is the most commonly overlooked assumption. While the test does not require the original data to follow a normal distribution, it does require that the differences between paired observations are roughly symmetric around the median. This does not mean the differences must be bell-shaped — only that they should not be heavily skewed in one direction. If this assumption is violated, the sign test is a more appropriate alternative, as it relies solely on the direction of differences rather than their magnitude.
The pairs are independent of one another
Each pair of observations must be independent from every other pair. The test cannot account for clustering, hierarchical structures, or repeated observations across more than two time points. Designs involving three or more related measurements require a different approach, such as the Friedman test.
The differences are measurable in magnitude
Because the test ranks the size of differences — not merely their direction — it requires that differences be quantifiable and comparable. If only the direction of change is known (greater or lesser) without any sense of magnitude, the sign test is again preferable.
Core Differences
The paired t-test works with the raw values of differences between pairs, computing a mean difference and assessing how far it deviates from zero relative to its standard error. This makes it sensitive to the actual magnitude of scores and highly efficient when data meet its assumptions. The Wilcoxon Signed Rank Test, by contrast, discards the raw values and instead ranks the absolute differences, then evaluates whether positive or negative ranks dominate. This rank-based approach sacrifices some precision in exchange for robustness.
Comparison Table
| Feature | Wilcoxon Signed Rank Test | Paired t-Test |
|---|---|---|
| Data type | Continuous or ordinal | Continuous |
| Distribution assumption | None (non-parametric) | Normality of differences |
| Basis of calculation | Ranks of differences | Mean of differences |
| Sensitivity to outliers | Low | High |
| Statistical power (when normality holds) | Slightly lower | Higher |
| Statistical power (when normality violated) | Higher | Lower |
| Suitable for small samples | Yes | Less reliable |
| Suitable for ordinal data | Yes | No |
| Software availability | Widely available | Widely available |
When the Paired t-Test Is Preferable
If your difference scores are approximately normally distributed and your sample is reasonably large, the paired t-test is the stronger choice. It makes fuller use of the data by preserving the actual magnitude of differences, and it carries greater statistical power under these conditions — meaning it is more likely to detect a true effect when one exists.
When the Wilcoxon Signed Rank Test Is Preferable
The Wilcoxon Signed Rank Test becomes the better option when normality cannot be assumed, when the data are ordinal rather than continuous, when the sample is small, or when outliers are present. In these circumstances, the paired t-test can produce unreliable p-values and misleading conclusions, while the Wilcoxon test remains stable and valid.
A Note on Statistical Power
The efficiency of the Wilcoxon Signed Rank Test relative to the paired t-test is approximately 95% when data are normally distributed — meaning it requires only slightly more observations to achieve the same power. Under non-normal conditions, the Wilcoxon test can actually surpass the t-test in power, making it not just a fallback option but sometimes the genuinely superior choice.
In practice, many researchers run a Shapiro-Wilk test on their difference scores before deciding between the two methods. If normality holds, they proceed with the paired t-test. If it does not — or if the data are ordinal — they switch to the Wilcoxon Signed Rank Test. This decision-based approach ensures that the chosen test is well-matched to the data at hand.
The Wilcoxon Signed Rank Test follows a structured series of steps that transform raw paired data into a test statistic. Working through a concrete example makes the process straightforward.
The Example Scenario
Ten participants completed a cognitive performance task before and after an intervention. Their scores are recorded below, and the goal is to determine whether the intervention produced a statistically significant change.
| Participant | Before | After | Difference (After − Before) |
|---|---|---|---|
| 1 | 45 | 52 | +7 |
| 2 | 63 | 61 | −2 |
| 3 | 38 | 38 | 0 |
| 4 | 71 | 80 | +9 |
| 5 | 55 | 60 | +5 |
| 6 | 49 | 45 | −4 |
| 7 | 66 | 74 | +8 |
| 8 | 42 | 48 | +6 |
| 9 | 57 | 53 | −3 |
| 10 | 60 | 67 | +7 |
Step 1: Calculate the Differences
Subtract the Before score from the After score for each participant. A positive difference indicates improvement; a negative difference indicates decline. Participant 3 recorded a difference of zero and is excluded from further analysis, reducing the effective sample size to n = 9.
Step 2: Rank the Absolute Differences
Ignore the signs and rank the absolute values of the differences from smallest to largest. When two or more differences share the same absolute value — as with Participants 1 and 10, who both recorded a difference of 7 — assign each the average of the ranks they would have occupied.
| Participant | Difference | Absolute Difference | Rank |
|---|---|---|---|
| 2 | −2 | 2 | 1 |
| 9 | −3 | 3 | 2 |
| 6 | −4 | 4 | 3 |
| 5 | +5 | 5 | 4 |
| 8 | +6 | 6 | 5 |
| 1 | +7 | 7 | 6.5 |
| 10 | +7 | 7 | 6.5 |
| 7 | +8 | 8 | 8 |
| 4 | +9 | 9 | 9 |
Step 3: Restore the Signs
Reattach the original sign of each difference to its rank, producing signed ranks.
| Participant | Difference | Rank | Signed Rank |
|---|---|---|---|
| 2 | −2 | 1 | −1 |
| 9 | −3 | 2 | −2 |
| 6 | −4 | 3 | −3 |
| 5 | +5 | 4 | +4 |
| 8 | +6 | 5 | +5 |
| 1 | +7 | 6.5 | +6.5 |
| 10 | +7 | 6.5 | +6.5 |
| 7 | +8 | 8 | +8 |
| 4 | +9 | 9 | +9 |
Step 4: Sum the Positive and Negative Ranks
Add up the signed ranks separately for positive and negative differences.
The test statistic W is the smaller of these two values: W = 6.
Step 5: Interpret the Test Statistic
With n = 9 and a significance level of α = 0.05 (two-tailed), the critical value from the Wilcoxon Signed Rank table is W_critical = 6. The null hypothesis is rejected when the calculated W is less than or equal to the critical value.
Since W = 6 ≤ 6, the result is statistically significant. There is sufficient evidence to conclude that the intervention produced a meaningful change in cognitive performance scores.
The Logic Behind the Method
If the intervention had no effect, positive and negative ranks would be roughly balanced, and both W⁺ and W⁻ would be similar in magnitude. A large imbalance — where one sum greatly exceeds the other — signals that differences consistently lean in one direction, providing evidence against the null hypothesis. The smaller the value of W, the more one-sided the evidence, and the stronger the grounds for rejecting the null.
The Wilcoxon Signed Rank Test does not rely on a single formula in the way that many parametric tests do. Instead, the test statistic is derived through a ranking procedure, with formal mathematical expressions used to standardise the result for larger samples. Understanding both the exact and approximate approaches clarifies how the method scales across different sample sizes.
The Test Statistic W
The core test statistic is defined as:
Where:
As a consistency check, the two rank sums must satisfy:
Where n is the number of non-zero differences remaining after pairs with a difference of zero are excluded. In the earlier example, , giving a total rank sum of , and indeed .
Exact vs Large-Sample Approach
For small samples (typically ), W is compared directly against a table of critical values. No further calculation is required — the observed W is simply checked against the critical value for the given n and significance level.
For larger samples (), the distribution of W approaches normality, and a Z-score approximation is used instead:
Where the expected value and standard deviation of W under the null hypothesis are:
The resulting Z-score is then compared against the standard normal distribution to obtain a p-value.
Correction for Ties
When tied absolute differences are present, the standard deviation formula requires a correction to account for the reduced variability introduced by averaged ranks:
Where:
This correction has a modest effect when ties are few, but becomes more consequential as the proportion of tied values increases.
Worked Calculation Using the Large-Sample Formula
Applying the Z-score formula to the earlier example (n = 9, W = 6) for illustration purposes:
A Z-score of −1.96 corresponds to a two-tailed p-value of approximately 0.05, consistent with the earlier conclusion that the result sits at the boundary of statistical significance. In practice, the exact method would be used for a sample this small, but the large-sample approximation produces a closely aligned result.
Effect Size: The Matched Rank Biserial Correlation
Reporting W alone does not convey the practical magnitude of the finding. The recommended effect size measure for the Wilcoxon Signed Rank Test is the matched rank biserial correlation r:
Applied to the example:
This value ranges from −1 to +1, where values near 0 indicate no effect and values approaching ±1 indicate a strong, consistent directional shift. By conventional benchmarks, 0.1 represents a small effect, 0.3 a medium effect, and 0.5 or above a large effect — placing the example result firmly in the large effect range.
R performs the Wilcoxon Signed Rank Test using the built-in wilcox.test() function. The paired = TRUE argument specifies that the data are matched pairs rather than independent samples.
r
before <- c(45, 63, 38, 71, 55, 49, 66, 42, 57, 60)
after <- c(52, 61, 38, 80, 60, 45, 74, 48, 53, 67)
result <- wilcox.test(after, before,
paired = TRUE,
exact = TRUE,
conf.int = TRUE)
print(result)
Key output fields:
V — the test statistic (equivalent to W⁺ in this implementation)p.value — the two-tailed p-valueconf.int — a confidence interval for the pseudomedian of differencesSetting exact = TRUE ensures R uses the exact distribution rather than the normal approximation, which is appropriate for small samples. For effect size, the rstatix package provides a convenient wilcox_effsize() function that returns the matched rank biserial correlation directly.
The SciPy library provides the Wilcoxon Signed Rank Test through scipy.stats.wilcoxon(). By default, pairs with zero differences are dropped automatically.
python
from scipy.stats import wilcoxon
before = [45, 63, 38, 71, 55, 49, 66, 42, 57, 60]
after = [52, 61, 38, 80, 60, 45, 74, 48, 53, 67]
differences = [a - b for a, b in zip(after, before)]
stat, p_value = wilcoxon(differences,
alternative='two-sided',
method='exact')
print(f"W = {stat}, p = {p_value}")
Key parameters:
alternative — set to 'two-sided', 'greater', or 'less' depending on your hypothesismethod — use 'exact' for small samples; 'approx' applies the normal approximation with continuity correctionFor effect size, divide the Z-statistic (available when method='approx') by the square root of the number of non-zero pairs, following the formula .
In SPSS, the Wilcoxon Signed Rank Test is accessed through the legacy nonparametric menu or via syntax.
Using the menu:
Using syntax:
spss
NPAR TESTS
/WILCOXON = before WITH after (PAIRED)
/MISSING ANALYSIS.
Key output tables:
To request the exact p-value in the menu, click Exact and select Exact under the Exact Tests dialog before running the analysis.
Excel does not include a native Wilcoxon Signed Rank Test function, but the procedure can be carried out manually using standard spreadsheet operations across a few organised columns.
Step-by-step layout:
| Column | Content |
|---|---|
| A | Before scores |
| B | After scores |
| C | Differences (=B2−A2) |
| D | Absolute differences (=ABS(C2)) |
| E | Ranks of absolute differences (using RANK.AVG) |
| F | Signed ranks (=IF(C2>0, E2, IF(C2<0, −E2, “”))) |
| G | Positive ranks only (=IF(F2>0, F2, 0)) |
| H | Negative ranks only (=IF(F2<0, ABS(F2), 0)) |
Sum columns G and H separately using SUMIF or direct SUM to obtain W⁺ and W⁻. The test statistic W is the smaller of the two. Compare this against a printed or online Wilcoxon critical values table for the appropriate n and significance level.
For the large-sample Z approximation, apply the formulas for μW and σW from the Formula section directly in additional cells, then use Excel’s NORM.S.DIST() function to convert the Z-score to a p-value.
Stata performs the Wilcoxon Signed Rank Test using the signrank command, which is concise and produces clearly labelled output.
stata
signrank after = before
Key output fields:
To request an exact p-value rather than the normal approximation, append the exact option:
stata
signrank after = before, exact
Stata also reports the number of positive, negative, and zero differences directly in the output table, making it straightforward to verify that the correct pairs have been included in the analysis.


Clinical and Medical Research
One of the most common applications is in clinical trials assessing the effect of a treatment on the same group of patients measured before and after an intervention. A researcher evaluating whether a new medication reduces blood pressure in hypertensive patients would record each participant’s systolic pressure at baseline and again after eight weeks of treatment. Because blood pressure data in small clinical samples is often skewed and may contain outliers, the Wilcoxon Signed Rank Test provides a more reliable analysis than a paired t-test.
The test is similarly used to assess changes in symptom severity scores — such as pain intensity measured on a visual analogue scale — where the underlying measurement is ordinal and the assumption of normality in the differences cannot be justified.
Psychology and Behavioural Science
Psychologists frequently use the test when comparing performance or attitudes measured at two time points. A study examining whether a mindfulness intervention reduces anxiety might ask participants to complete a standardised anxiety scale before and after an eight-week programme. Because Likert-based psychological scales produce ordinal rather than truly continuous data, the Wilcoxon Signed Rank Test is the methodologically appropriate choice.
It also appears in reaction time studies, where distributions are typically right-skewed and outliers are common — conditions that make the t-test unreliable.
Education Research
Researchers assessing the impact of a teaching intervention on student outcomes often collect pre- and post-test scores from the same cohort. When class sizes are small — as is typical in pilot studies or specialist programmes — normality cannot be assumed. The Wilcoxon Signed Rank Test allows researchers to determine whether scores improved significantly without requiring a distributional assumption that the sample size cannot support.
Nutrition and Exercise Science
Studies examining the effect of a dietary programme or exercise regimen on physiological markers — such as resting heart rate, body mass index, or cholesterol levels — routinely use the Wilcoxon Signed Rank Test. These studies often involve small participant groups, measurements that are not normally distributed, and data collected from each participant at two time points, making the test well-matched to the design.
Quality Control and Industrial Testing
In manufacturing and quality assurance, paired measurements are taken on the same unit under two different conditions — such as before and after a calibration adjustment, or using two different measurement instruments on the same set of components. When the differences between conditions are not normally distributed, the Wilcoxon Signed Rank Test provides a robust method for determining whether a systematic difference exists between the two conditions.
Sensory Evaluation and Consumer Research
Food scientists and consumer researchers often ask participants to rate the same product under two different conditions — for example, two formulations of a food product rated for perceived sweetness, or two packaging designs rated for perceived quality. Because such ratings are ordinal and sample sizes in sensory panels are typically modest, the Wilcoxon Signed Rank Test is a standard analytical tool in this context.
Environmental Science
Environmental researchers comparing pollutant concentrations measured at the same sampling sites across two time periods — such as before and after a regulatory intervention — use the Wilcoxon Signed Rank Test when concentration data are skewed or when the number of monitoring sites is small. The paired structure of the data, with each site serving as its own control, maps directly onto the test’s design requirements.
Wilcoxon Signed Rank Test: used for paired/related samples (e.g., before vs after).
Mann–Whitney U Test: used for independent samples (two different groups).
Wilcoxon: for two related groups
Kruskal–Wallis: for three or more independent groups
ANOVA is a parametric test (assumes normal distribution and equal variances)