The Wilcoxon Signed Rank Test is a nonparametric statistical method used to analyze paired or matched observations. It is commonly applied to before-and-after measurements, repeated observations from the same participants, and matched-pair studies when a paired t-test is not the most suitable choice.
Unlike the paired t-test, this rank-based method does not require paired differences to follow a normal distribution. However, it is not assumption-free. One of its most important assumptions is that the distribution of paired differences is reasonably symmetric.
The test works by calculating the difference between each pair of observations, ranking the absolute differences, restoring their positive or negative signs, and comparing the sums of those signed ranks.
This guide explains the Wilcoxon Signed Rank Test assumptions, formula, hypotheses, calculation steps, worked example, p-value, critical values, effect size, sample size, interpretation, ties, zero differences, and how to perform and report the analysis using R, Python, and SPSS.
Quick Answer: What Is the Wilcoxon Signed Rank Test?
The Wilcoxon Signed Rank Test is a nonparametric test used to compare two related or paired measurements, such as before-and-after results from the same participants. It analyzes the signs and ranks of the paired differences to determine whether there is evidence of a systematic change, without requiring those differences to follow a normal distribution.
Wilcoxon Signed Rank Test at a Glance
The Wilcoxon Signed Rank Test can be summarized quickly using the key characteristics below.
| Feature | Answer |
|---|---|
| Test type | Nonparametric |
| Main use | Paired, matched, or one-sample data |
| Common alternative to | Paired t-test |
| Normality required? | No |
| Symmetry important? | Yes, for the classical interpretation |
| Uses raw differences directly? | No |
| Uses ranks? | Yes |
| Common null difference | 0 |
| Main output | Test statistic and p-value |
| Useful effect size | Rank-biserial correlation |
| Independent-group alternative | Mann-Whitney U / Wilcoxon rank-sum test |
Key Takeaways
- The Wilcoxon Signed Rank Test is mainly designed for paired or matched observations.
- It does not require normally distributed paired differences.
- Approximate symmetry of the paired differences is important for the classical interpretation.
- It uses the direction and ranks of differences rather than their raw magnitudes directly.
- Zero differences and tied absolute differences require special handling.
- A small p-value provides evidence against the null hypothesis.
- A non-significant result does not prove that two conditions are identical.
- Effect size and confidence intervals provide information that a p-value alone cannot.
- R, Python and SPSS may report different-looking statistics because their conventions can differ.
- The signed-rank test should not be confused with the Wilcoxon rank-sum or Mann-Whitney U test.
What Does the Wilcoxon Signed Rank Test Measure?
Suppose employees complete the same task before and after training.
Each employee produces two observations:
- completion time before training
- completion time after training
For participant ii, calculate:
di=Xi−Yid_i = X_i – Y_i
where:
- XiX_i = first measurement
- YiY_i = second measurement
- did_i = paired difference
The Wilcoxon Signed Rank Test evaluates whether positive and negative differences are systematically unbalanced after accounting for their relative magnitudes.
This distinguishes the test from a basic sign test.
The sign test mainly considers whether changes are positive or negative. The Wilcoxon method additionally ranks how large those differences are.
One-Sample vs Paired Wilcoxon Signed Rank Test
The Wilcoxon Signed Rank Test can be used in two closely related situations.
| Version | What It Tests | Example |
|---|---|---|
| One-sample | Whether observations are centered around a specified value | Is processing time centered around 10 minutes? |
| Paired | Whether paired differences are centered around a specified value | Did blood pressure change after treatment? |
One-Sample Version
For a hypothesized location:
θ0\theta_0
calculate:
di=Xi−θ0d_i = X_i – \theta_0
The signed-rank procedure is then applied to those differences.
Paired Version
For two related measurements:
di=Xi−Yid_i = X_i – Y_i
The ranking process is then applied to the paired differences.
Is the Wilcoxon Signed Rank Test a Test of Medians?
This is one of the most commonly misunderstood parts of the procedure.
The test is frequently described as asking whether the median paired difference equals zero.
That explanation is useful, but it needs an important qualification.
More precisely, the classical signed-rank procedure tests a symmetric location model. When the distribution of the differences is symmetric, its location corresponds to its median.
R’s official documentation describes the paired procedure as testing whether the distribution of:
x−yx-y
is symmetric about a specified location parameter.
A more technically accurate interpretation is:
Under an approximately symmetric distribution of differences, the Wilcoxon Signed Rank Test can be interpreted as testing whether the center or median difference equals the hypothesized value.
When Should You Use the Wilcoxon Signed Rank Test?
Typical applications include:
| Situation | Example |
|---|---|
| Before-and-after study | Blood pressure before and after medication |
| Training study | Employee performance before and after training |
| Clinical research | Pain ratings before and after treatment |
| Repeated measurement | Reaction times under two conditions |
| Matched subjects | Matched patients receiving different treatments |
| Product testing | Same consumers rating two products |
| One-sample analysis | Measurements compared with a target |
The key requirement is that observations within a pair have a meaningful relationship.
Wilcoxon Signed Rank Test Assumptions
The Wilcoxon Signed Rank Test has several important assumptions that should be checked before using it. Although it is a nonparametric test, that does not mean it is completely assumption-free.
1. The Data Should Be Paired or Matched
The test is designed for related observations. This means each value in one condition should have a meaningful match in the other condition.
For example, you might compare the same patients before and after treatment, the same students before and after a course, or matched participants in two conditions.
If the two groups are independent, another test such as the Mann-Whitney U test may be more appropriate.
2. Each Pair Should Be Independent of Other Pairs
The two observations within a pair are expected to be related. However, one pair should generally not influence another pair.
For example, one participant’s before-and-after measurements should not determine the measurements of another participant.
3. The Differences Must Be Rankable
The test must be able to determine whether each paired difference is positive or negative and compare the sizes of those differences.
The paired difference is calculated as:
di=Xi−Yid_i = X_i – Y_i
The absolute differences are then ranked from smallest to largest.
4. The Paired Differences Should Be Approximately Symmetric
This is one of the most important assumptions of the test.
Researchers should look at the distribution of the paired differences rather than checking whether the two original variables are separately normal.
The differences do not need to follow a normal distribution. However, they should be reasonably balanced around their center without severe skewness.
If the difference distribution is strongly asymmetric, the sign test may sometimes be a better choice.
5. The Study Design Should Support the Analysis
The quality of the result also depends on the way the data were collected.
Researchers should consider factors such as participant selection, missing observations, measurement quality, clustering, and possible confounding variables.
A statistical test can analyze the available data, but it cannot correct weaknesses in the original study design.
Does the Wilcoxon Signed Rank Test Require Normality?
No. The Wilcoxon Signed Rank Test does not require paired differences to follow a normal distribution, which is one reason it is often considered when the paired t-test is not suitable.
However, the shape of the difference distribution still matters. In particular, the paired differences should generally be approximately symmetric for the classical signed-rank interpretation.
| Requirement | Wilcoxon Signed Rank Test |
|---|---|
| Normal differences required? | No |
| Approximate symmetry important? | Yes |
| Paired observations required? | Yes for paired analysis |
| Independent pairs required? | Yes |
| Uses ranks? | Yes |
| Works with non-normal data? | Often, when the other assumptions are appropriate |
Do not automatically choose the Wilcoxon test simply because a normality test gives a significant result.
Instead, consider the research question, sample size, symmetry of the paired differences, unusual observations, and the scientific meaning of the measurements.
How to Check the Symmetry Assumption

Start by calculating the paired differences:
di=Xi−Yid_i = X_i – Y_i
Then examine the distribution of those differences using:
- a histogram
- a boxplot
- a dot plot
- a density plot
- descriptive statistics
- direct inspection for small samples
Look for signs of strong asymmetry. Ask whether one tail is much longer than the other, whether the values are reasonably balanced around the center, and whether one or two extreme observations are creating the apparent skewness.
Perfect symmetry is not required. However, substantial skewness can weaken the classical interpretation of the Wilcoxon signed-rank procedure.
Wilcoxon Signed Rank Test Hypotheses
Let:
D=X−YD = X – Y
represent the paired difference.
For a common two-sided Wilcoxon Signed Rank Test, the hypotheses are:
H0:θD=0H_0:\theta_D = 0
versus:
H1:θD≠0H_1:\theta_D \neq 0
where θD\theta_D represents the location of the difference distribution.
When the distribution of the paired differences is approximately symmetric, the hypotheses are often expressed as:
H0:Median Difference=0H_0:\text{Median Difference} = 0
versus:
H1:Median Difference≠0H_1:\text{Median Difference} \neq 0
This means the null hypothesis assumes no systematic location shift between the paired measurements, while the alternative hypothesis indicates that a shift is present.
One-Tailed vs Two-Tailed Wilcoxon Signed Rank Test
The Wilcoxon Signed Rank Test can be used as either a two-sided or one-sided test, depending on the research question.
A two-sided test is appropriate when you want to know whether the paired measurements differ in either direction. In this case, the alternative hypothesis is:
H1:θD≠0H_1:\theta_D \neq 0
A one-sided test is used when the expected direction of change is defined in advance. If positive differences support the hypothesis, use:
H1:θD>0H_1:\theta_D > 0
If negative differences support the hypothesis, use:
H1:θD<0H_1:\theta_D < 0
The direction of the test depends on how the paired difference is calculated. For example, if you define the difference as:
d=Before−Afterd = \text{Before} – \text{After}
positive values mean the before measurement is larger. If you reverse the calculation:
d=After−Befored = \text{After} – \text{Before}
the signs also reverse.
For this reason, decide how the difference will be calculated before selecting a one-sided alternative. A two-sided test is generally used when the goal is simply to determine whether a change occurred, while a one-sided test is appropriate when a specific increase or decrease was predicted in advance.
Do not choose a one-sided test only after seeing the direction of the results, because that can make the statistical conclusion misleading.
Wilcoxon Signed Rank Test Formula
The procedure starts with:
di=Xi−Yid_i=X_i-Y_i
Step 1: Calculate Differences
For every matched pair:
di=Xi−Yid_i=X_i-Y_i
Step 2: Handle Zero Differences
Under the traditional Wilcox convention, differences equal to zero are excluded before ranking.
Step 3: Calculate Absolute Differences
Calculate:
∣di∣|d_i|
and temporarily ignore each sign.
Step 4: Rank the Absolute Differences
Rank the absolute differences from smallest to largest:
1,2,3,…,n1,2,3,\ldots,n
When values are tied, assign their average rank.
Step 5: Restore Each Sign
Return the original positive or negative sign.
Step 6: Calculate the Positive Rank Sum
W+=∑Ri+W^+=\sum R_i^+
Step 7: Calculate the Negative Rank Sum
W−=∑Ri−W^-=\sum R_i^-
where W−W^- is commonly written as the magnitude of the ranks associated with negative differences.
Step 8: Calculate the Test Statistic
A common two-sided convention is:
T=min(W+,W−)T=\min(W^+,W^-)
Different statistical programs may report different versions of the statistic.
Always check the software convention before comparing numerical WW, TT or VV values across programs.
Total Rank Sum Formula
For nn usable differences:
1+2+⋯+n=n(n+1)21+2+\cdots+n= \frac{n(n+1)}{2}
Therefore:
W++W−=n(n+1)2W^++W^-= \frac{n(n+1)}{2}
when the positive and negative rank sums are represented as magnitudes.
This provides a simple manual accuracy check.
Large-Sample Approximation
For larger samples, the distribution of the Wilcoxon signed-rank statistic can be approximated using a normal distribution. This allows researchers to calculate a standardized test statistic and estimate the p-value without relying on an exact distribution.
When there are no ties or zero differences, the expected value of the positive rank sum is:
E(W+)=n(n+1)4E(W^+) = \frac{n(n+1)}{4}
and its variance is:
Var(W+)=n(n+1)(2n+1)24Var(W^+) = \frac{n(n+1)(2n+1)}{24}
A standardized statistic can then be calculated as:
Z=W+−E(W+)Var(W+)Z = \frac{W^+ – E(W^+)}{\sqrt{Var(W^+)}}
In real datasets, statistical software may also account for ties, zero differences, and continuity corrections. Some programs can use exact or permutation-based calculations instead of the normal approximation.
For most practical analyses, it is better to use statistical software rather than calculate the large-sample approximation manually, especially when the data contain ties or zero differences.
Wilcoxon Signed Rank Test Example
Suppose a company wants to test whether training changes employee task-completion times.
Define the paired difference as:
d=Before−Afterd = \text{Before} – \text{After}
Positive differences therefore represent faster performance after training.
| Employee | Before | After | Difference | Absolute Difference | Rank | Signed Rank |
|---|---|---|---|---|---|---|
| 1 | 50 | 51 | -1 | 1 | 1 | -1 |
| 2 | 52 | 50 | +2 | 2 | 2 | +2 |
| 3 | 57 | 54 | +3 | 3 | 3 | +3 |
| 4 | 61 | 57 | +4 | 4 | 4 | +4 |
| 5 | 65 | 60 | +5 | 5 | 5 | +5 |
| 6 | 70 | 64 | +6 | 6 | 6 | +6 |
| 7 | 73 | 66 | +7 | 7 | 7 | +7 |
| 8 | 80 | 72 | +8 | 8 | 8 | +8 |
Calculate the Positive Ranks
W+=2+3+4+5+6+7+8W^+ = 2+3+4+5+6+7+8 W+=35W^+ = 35
Calculate the Negative Ranks
W−=1W^- = 1
Check the Total
For:
n=8n=8
The total rank sum should be:
8(9)2=36\frac{8(9)}{2}=36
and:
35+1=3635+1=36
so the ranking is correct.
Calculate the Test Statistic
Using the smaller-rank-sum convention:
T=min(35,1)T=\min(35,1) T=1T=1
The exact two-sided p-value for this rank pattern is:
p=0.015625p=0.015625
or approximately:
p=0.016p=0.016
At:
α=0.05\alpha=0.05
we have:
p<0.05p<0.05
Therefore, reject the null hypothesis.
Interpretation
The Wilcoxon Signed Rank Test provides statistically significant evidence that task-completion times changed after training.
Because nearly all differences were positive when calculated as:
Before−After\text{Before}-\text{After}
the sample suggests that employees generally completed tasks faster after training.
However, the statistical result alone does not prove that training caused the improvement. Causal conclusions depend on the overall research design.
Wilcoxon Signed Rank Test Critical Values
Traditional calculations compare the observed statistic with a Wilcoxon Signed Rank Test critical value.
Using:
T=min(W+,W−)T=\min(W^+,W^-)
the following are common two-sided critical values at:
α=0.05\alpha=0.05
| Effective n | Critical T |
|---|---|
| 5 | No rejection possible at 0.05 |
| 6 | 0 |
| 7 | 2 |
| 8 | 3 |
| 9 | 5 |
| 10 | 8 |
| 11 | 10 |
| 12 | 13 |
| 13 | 17 |
| 14 | 21 |
| 15 | 25 |
The traditional decision rule is:
Tobserved≤TcriticalT_{\text{observed}} \leq T_{\text{critical}}
If this condition is met, reject the null hypothesis.
Example
In the worked example:
n=8n=8
and:
T=1T=1
For n=8n=8, the critical value is:
Tcritical=3T_{\text{critical}}=3
Since:
1≤31\leq3
the result is statistically significant at the two-sided 5% level.
Today, software-generated p-values are usually preferable because ties, zero differences, and different test-statistic conventions can make table-based calculations more complicated.
What Does the P-Value Mean?
The Wilcoxon Signed Rank Test p-value indicates how unusual the observed rank pattern would be if the null hypothesis were true.
At:
α=0.05\alpha = 0.05
a common decision rule is:
| P-Value | Decision |
|---|---|
| p<0.05p < 0.05 | Reject H0H_0 |
| p>0.05p > 0.05 | Fail to reject H0H_0 |
However, avoid treating 0.05 as a strict dividing line between meaningful and meaningless results.
For example:
p=0.049p = 0.049
is not fundamentally different from:
p=0.051p = 0.051
The p-value should be interpreted alongside effect size, confidence intervals, study design, sample size, and practical importance.
Exact vs Approximate P-Values
Depending on the sample size, data structure, and statistical software, the p-value may be calculated using:
- exact inference
- conditional exact inference
- permutation methods
- an asymptotic normal approximation
Ties and zero differences can affect which method is appropriate or available.
In R, the wilcox.test() function supports one-sample and paired analyses and provides options related to exact calculations, continuity correction, and confidence intervals.
For reproducible research, report the p-value calculation method when it could meaningfully affect the result, especially in small samples or datasets with many ties or zero differences.
How Are Ties Handled?
A tie occurs when two or more observations have the same absolute difference.
Suppose the absolute differences are:
∣d∣=1,2,2,4|d| = 1, 2, 2, 4
The two values of 2 would occupy ranks 2 and 3. Because they are tied, each receives the average of those two ranks:
2+32=2.5\frac{2+3}{2}=2.5
The final ranks are therefore:
1, 2.5, 2.5, 41,\ 2.5,\ 2.5,\ 4
Ties can affect rank sums, variance calculations, exact inference, and p-values. However, tied differences do not automatically make the Wilcoxon Signed Rank Test invalid.
How Are Zero Differences Handled?
A zero difference occurs when:
Xi−Yi=0X_i-Y_i=0
Several approaches exist.
| Method | Treatment |
|---|---|
| Wilcox | Discards zero differences |
| Pratt | Includes zeros while assigning ranks but excludes their signed contribution |
| Z-split | Splits zero-rank contribution between positive and negative sums |
SciPy supports these three zero_method options, with wilcox as the default.
When many zero differences occur, report the method used.
Example With Ties and Zero Differences
Suppose the observed differences are:
0, +2, −2, +5, −70,\ +2,\ -2,\ +5,\ -7
Using the traditional Wilcox convention, remove the zero difference before ranking.
The remaining absolute differences are:
2, 2, 5, 72,\ 2,\ 5,\ 7
The two values equal to 2 would occupy ranks 1 and 2. Because they are tied, each receives the average rank of:
1.51.5
| Difference | Absolute Difference | Rank | Signed Rank |
|---|---|---|---|
| +2 | 2 | 1.5 | +1.5 |
| -2 | 2 | 1.5 | -1.5 |
| +5 | 5 | 3 | +3 |
| -7 | 7 | 4 | -4 |
Therefore:
W+=4.5W^+ = 4.5
and:
W−=5.5W^- = 5.5
This example shows why Wilcoxon Signed Rank Test output can contain fractional rank sums when tied absolute differences receive average ranks.
Missing Data and Effective Sample Size
A paired analysis requires enough information to calculate a difference for each usable pair. If one measurement in a pair is missing, that pair may not be included in the final analysis.
Researchers should distinguish between:
NrecruitedN_{\text{recruited}}
and:
nanalyzedn_{\text{analyzed}}
For transparent reporting, state:
- original sample size
- missing measurements
- excluded pairs
- zero differences
- final usable sample size
The effective sample size for the Wilcoxon Signed Rank Test may therefore be smaller than the number of participants originally recruited.
Is There a Minimum Sample Size?
There is no universal minimum sample size such as 20 or 30 observations for the Wilcoxon Signed Rank Test.
However, very small samples provide limited statistical resolution because the exact null distribution is discrete.
For example, with five usable non-zero differences, the smallest possible conventional two-sided exact p-value is:
p=0.0625p = 0.0625
Therefore, when:
n=5n = 5
a two-sided exact test cannot achieve:
p<0.05p < 0.05
The test can still be calculated, but it cannot cross the conventional 5% significance threshold with only five usable non-zero differences.
Sample Size and Statistical Power
The appropriate sample size for a Wilcoxon Signed Rank Test depends on several factors, including:
- expected effect size
- desired statistical power
- significance level
- one-sided or two-sided testing
- distribution of the paired differences
- expected ties
- expected zero differences
- missing observations
- participant dropout
Statistical power is commonly expressed as:
Power=1−β\text{Power} = 1 – \beta
where β\beta represents the probability of a Type II error.
A power level of 80% is commonly used in many fields, but it is not a universal requirement.
For important research, use an appropriate power analysis or simulation rather than relying on a fixed sample-size rule.
Wilcoxon Signed Rank Test Effect Size
A p-value tells you how much evidence the data provide against the null hypothesis. It does not tell you how large the effect is.
A useful effect-size measure for the Wilcoxon Signed Rank Test is the matched-pairs rank-biserial correlation:
rrb=W+−W−W++W−r_{rb} = \frac{W^+ – W^-}{W^+ + W^-}
Its theoretical range is:
−1≤rrb≤1-1 \leq r_{rb} \leq 1
Values near +1 indicate that the signed ranks strongly favor positive differences. Values near -1 indicate that they strongly favor negative differences, while values near 0 indicate more balanced positive and negative ranks.
Effect Size for the Worked Example
In the worked example:
W+=35W^+ = 35
and:
W−=1W^- = 1
Therefore:
rrb=35−135+1r_{rb} = \frac{35-1}{35+1} rrb=3436r_{rb} = \frac{34}{36} rrb≈0.94r_{rb} \approx 0.94
The rank-biserial correlation therefore strongly favors the positive direction in this sample.
Avoid applying universal “small,” “medium,” or “large” labels automatically. The practical importance of an effect should be interpreted in the context of the research question and field.
What About r = Z / √N?
Another commonly reported effect size for the Wilcoxon Signed Rank Test is:
r=ZNr = \frac{Z}{\sqrt{N}}
If you use this approach, clearly report how ZZ was calculated and how NN was defined. You should also explain how zero differences, tied ranks, and continuity corrections were handled.
These choices can vary between statistical software packages, so documenting the calculation method helps make the analysis easier to reproduce and compare.
Hodges-Lehmann Estimate and Confidence Intervals
A high-quality Wilcoxon analysis should ideally communicate effect magnitude and uncertainty.
Rank-based procedures can provide a location estimate associated with the Hodges-Lehmann estimator and a corresponding confidence interval.
For one-sample paired differences, this involves Walsh averages such as:
di+dj2\frac{d_i+d_j}{2}
A confidence interval helps answer:
How large could the underlying location shift plausibly be?
R’s wilcox.test() includes options for confidence intervals and location estimates.
This is more informative than reporting only:
p < 0.05.
How to Interpret the Wilcoxon Signed Rank Test
A complete interpretation of the Wilcoxon Signed Rank Test should consider:
- direction of the differences
- test statistic
- p-value
- effect size
- descriptive statistics
- confidence interval
- study design
If p ≤ α
Reject the null hypothesis.
For example:
p=0.018,α=0.05p = 0.018,\quad \alpha = 0.05
Because:
0.018<0.050.018 < 0.05
the result is statistically significant.
If p > α
Fail to reject the null hypothesis.
For example:
p=0.21p = 0.21
Because:
0.21>0.050.21 > 0.05
the evidence is insufficient to reject the null hypothesis.
Do Not Say “Accept the Null Hypothesis”
A non-significant result does not prove that the null hypothesis is true.
The preferred wording is:
“We failed to reject the null hypothesis.”
A non-significant result can occur for several reasons, including:
- little or no true effect
- an insufficient sample size
- substantial variability
- low statistical power
- many zero differences
- measurement uncertainty
For this reason, a non-significant result should be interpreted as insufficient evidence against the null hypothesis, not as proof that the null hypothesis is correct.
A Non-Significant Result Does Not Prove Equivalence
Suppose:
p=0.28p=0.28
This does not establish that the two conditions are equal.
It only means that the study did not obtain sufficient evidence against the null hypothesis.
If the research question concerns whether two conditions are sufficiently similar, an equivalence-testing framework should be designed around a predefined acceptable difference.
Therefore:
p>0.05p>0.05
does not mean:
“There is definitely no difference.”
Statistical Significance vs Practical Significance
A very large sample might produce:
p<0.001p<0.001
for a change that is too small to matter scientifically or practically.
Conversely, a meaningful effect in a small sample may not achieve statistical significance.
Always distinguish:
Statistical significance: Is there sufficient evidence against the null model?
Practical significance: Is the size of the observed change important?
Wilcoxon Signed Rank Test vs Paired T-Test
| Feature | Wilcoxon Signed Rank Test | Paired T-Test |
|---|---|---|
| Paired observations | Yes | Yes |
| Uses paired differences | Yes | Yes |
| Requires normal differences | No | Approximately, particularly relevant in small samples |
| Symmetry assumption | Important | Not the defining assumption |
| Uses raw differences | No, uses ranks | Yes |
| Main focus | Rank-based location | Mean difference |
| Parametric? | No | Yes |
| Influence of extreme magnitudes | Usually lower | Usually higher |
Do not reduce the choice to:
Normal = t-test; non-normal = Wilcoxon.
Consider the research question, distribution, sample size, symmetry, outliers and scientific interpretation.
Wilcoxon Signed Rank Test vs Sign Test
| Feature | Wilcoxon Signed Rank | Sign Test |
|---|---|---|
| Uses direction | Yes | Yes |
| Uses relative magnitude | Yes | No |
| Symmetry important | Yes | No |
| Useful for severe skewness | Less suitable | More suitable |
| Potential power | Often higher when assumptions hold | Usually lower |
If symmetry is badly violated, the sign test may sometimes be the more appropriate rank-free alternative.
Wilcoxon Signed Rank Test vs Mann-Whitney U
These two rank-based tests are often confused, but they are used for different types of data.
Wilcoxon Signed Rank Test
Use the Wilcoxon Signed Rank Test for:
- paired observations
- repeated measurements
- matched samples
- before-and-after comparisons
Mann-Whitney U / Wilcoxon Rank-Sum Test
Use the Mann-Whitney U test for:
- two independent groups
- unrelated samples
- comparisons where observations in one group are not matched with observations in the other
The key difference is simple: the Wilcoxon Signed Rank Test is for related data, while the Mann-Whitney U test is for independent groups.
Wilcoxon Signed Rank Test vs Friedman Test
The Wilcoxon Signed Rank Test is typically used to compare two related conditions.
If the same participants are measured under three or more related conditions, the Friedman test may be a more appropriate rank-based omnibus test.
For example:
- baseline
- one month
- three months
If the Friedman test shows a significant overall difference, follow-up paired comparisons may be performed to determine which conditions differ. When several pairwise tests are used, a correction for multiple comparisons should be considered.
Which Statistical Test Should You Choose?
| Data Situation | Common Choice |
|---|---|
| Two paired measurements with roughly normal differences | Paired t-test |
| Two paired measurements with symmetric non-normal differences | Wilcoxon Signed Rank Test |
| Two paired measurements with strongly asymmetric differences | Sign test |
| Two independent groups | Mann-Whitney U or independent t-test |
| Three or more related conditions | Friedman test or repeated-measures model |
| Three or more independent groups | Kruskal-Wallis or ANOVA |
| Paired binary outcomes | McNemar test |
This table provides a useful starting point, but the final choice should also consider the research question, data type, sample size, distributional assumptions, and study design.
Multiple Wilcoxon Tests and P-Value Correction
Suppose participants are measured at:
- Time 1
- Time 2
- Time 3
You could perform:
- Time 1 vs Time 2
- Time 1 vs Time 3
- Time 2 vs Time 3
Running several Wilcoxon Signed Rank Tests increases the chance of false-positive results across the full set of comparisons.
Common p-value correction methods include:
| Method | Purpose |
|---|---|
| Holm | Family-wise error control |
| Bonferroni | Simple family-wise correction |
| Hochberg | Step-up family-wise procedure |
| Benjamini-Hochberg | False discovery rate control |
| Benjamini-Yekutieli | FDR control under broader dependence |
For confirmatory analysis, the correction method should ideally be selected as part of the analysis plan rather than chosen after checking which comparisons are statistically significant.
How to Perform the Wilcoxon Signed Rank Test in R
In R, you can perform the Wilcoxon Signed Rank Test using the wilcox.test() function.
before <- c(50, 52, 57, 61, 65, 70, 73, 80)
after <- c(51, 50, 54, 57, 60, 64, 66, 72)
wilcox.test(
before,
after,
paired = TRUE,
alternative = "two.sided"
)
You can also calculate the paired differences first:
difference <- before - after
wilcox.test(
difference,
mu = 0,
alternative = "two.sided"
)
Current R documentation supports:
- one-sample signed-rank testing
- paired testing
- two-sided, greater, and less alternatives
- exact calculations
- continuity correction
- confidence intervals
Calculating the differences first can also make it easier to inspect symmetry, zero differences, and tied values before running the test.
How to Perform the Wilcoxon Signed Rank Test in Python
SciPy provides scipy.stats.wilcoxon():
from scipy.stats import wilcoxon
before = [50, 52, 57, 61, 65, 70, 73, 80]
after = [51, 50, 54, 57, 60, 64, 66, 72]
result = wilcoxon(before, after)
print(result.statistic)
print(result.pvalue)
You can also calculate differences first:
differences = [
b - a for b, a in zip(before, after)
]
result = wilcoxon(differences)
SciPy provides controls for zero differences and directional alternatives.
Important Python Rounding Issue
Floating-point arithmetic can make values that should theoretically be tied differ by tiny amounts.
For example, two theoretical differences of:
0.30.3
might be stored internally as slightly different values.
When measurement precision justifies it, appropriately rounding calculated differences before ranking can prevent meaningless floating-point noise from changing rank assignments.
How to Run the Wilcoxon Signed Rank Test in SPSS
A commonly used SPSS route is:
Analyze → Nonparametric Tests → Legacy Dialogs → 2 Related Samples
Then:
- select the two paired variables
- choose Wilcoxon
- run the analysis
- inspect the rank information
- review the test statistic
- interpret the p-value
Record the SPSS version and important analysis settings when reproducibility matters.
Why R, Python and SPSS May Give Different Results
R, Python, and SPSS can sometimes report different-looking Wilcoxon Signed Rank Test results even when they are analyzing the same data.
Possible reasons include:
- different test-statistic conventions
- zero-difference handling
- treatment of ties
- continuity corrections
- exact calculation methods
- approximation methods
- rounding procedures
For example, one program may display:
W+W^+
while another reports:
min(W+,W−)\min(W^+, W^-)
The numerical test statistic can therefore differ even when the underlying ranking and conclusion are consistent.
Before assuming there is an error, compare the software version, alternative hypothesis, zero-handling method, exact or approximate calculation, continuity correction, and treatment of tied values.
How to Report a Wilcoxon Signed Rank Test
A strong Wilcoxon Signed Rank Test report should include:
- conditions that were compared
- number of usable pairs
- relevant descriptive statistics
- direction of the paired differences
- test statistic
- whether the test was one-sided or two-sided
- p-value
- exact or approximate calculation method when relevant
- effect size
- confidence interval when available
- treatment of ties and zero differences when important
Reporting Example
A concise report could state:
A Wilcoxon signed-rank test indicated that task-completion times differed after training, T=1T = 1, n=8n = 8, two-sided exact p=.016p = .016. The matched-pairs rank-biserial correlation was rrb=.94r_{rb} = .94, with the signed ranks strongly favoring faster post-training task completion.
Use the test-statistic notation reported by your statistical software. Different programs may report TT, WW, VV, or another convention, so do not copy the notation from another source without checking what your software output represents.
Common Wilcoxon Signed Rank Test Mistakes
Even though the Wilcoxon Signed Rank Test is widely used, several mistakes can lead to incorrect conclusions.
- Calling It Assumption-Free: Nonparametric methods still have assumptions. The signed-rank test does not require normality, but factors such as symmetry and the paired structure of the data still matter.
- Checking the Wrong Distribution: For paired analysis, focus on the distribution of the paired differences rather than checking the two original variables separately.
- Using It for Independent Groups: The test is designed for paired or matched observations. Independent groups require a different procedure such as the Mann-Whitney U test when appropriate.
- Saying It Tests Means: The procedure does not directly test the arithmetic mean difference in the way a paired t-test does.
- Saying It Always Tests the Median: Describing the procedure simply as a median test can oversimplify the underlying symmetric location model.
- Ignoring Zero Differences: Zero differences can reduce the effective sample size and influence the way the test is calculated.
- Ignoring Ties: Tied absolute differences affect rank assignments and may also influence p-value calculations.
- Reporting Only p < 0.05: A p-value alone does not describe the size or practical importance of an effect. Include an effect size and confidence interval when possible.
- Treating p > 0.05 as Proof of Equality: A non-significant result does not prove that two conditions are equal or equivalent.
- Choosing a One-Sided Test After Seeing the Results: The directional hypothesis should normally be specified before examining the results.
- Ignoring Multiple Testing: Running several paired comparisons increases the chance of false-positive findings. An appropriate p-value correction may be needed.
- Claiming Causation From Statistical Significance: A statistically significant result does not prove that one condition caused the observed change. Causal conclusions depend on the overall research design.
Advantages of the Wilcoxon Signed Rank Test
Key advantages include:
- Does not require normally distributed paired differences
- Works well with matched and repeated observations
- Considers both the direction and relative magnitude of differences
- Is less influenced by extreme raw magnitudes than mean-based methods
- Can be useful for some small-sample analyses
- Is widely available in statistical software
- Can be reported with rank-based effect sizes and confidence intervals
Limitations
Important limitations include:
- Approximate symmetry of paired differences remains important
- Ties can complicate exact inference
- Zero differences may reduce the effective sample size
- The test does not directly evaluate the arithmetic mean difference
- Very small samples can have low statistical power
- Software packages may use different calculation conventions
- Statistical significance does not guarantee practical importance
- Nonparametric testing cannot correct weaknesses in the study design
Can the Wilcoxon Signed Rank Test Handle Outliers?
Because the test uses ranks, extremely large raw values generally have less direct influence than they would in a mean-based analysis.
However, unusual observations should still be investigated carefully.
An outlier could represent:
- genuine variation
- measurement error
- data-entry error
- equipment failure
- protocol violation
- a genuinely different subgroup
Do not remove an observation simply because it produces an inconvenient result. Any exclusion should be supported by a clear scientific or data-quality reason.
Practical Wilcoxon Signed Rank Test Checklist
Before interpreting a Wilcoxon Signed Rank Test, check the following:
- Are the measurements genuinely paired?
- Are separate pairs reasonably independent?
- How was the paired difference defined?
- Are the paired differences approximately symmetric?
- Are there important outliers?
- Are any measurements missing?
- Are there zero differences?
- Are there tied absolute differences?
- Is the test one-sided or two-sided?
- Was an exact, permutation, or asymptotic method used?
- Was an effect size calculated?
- Is a confidence interval available?
- Were multiple comparisons corrected when necessary?
- Is the observed effect practically meaningful?
- Are the software version and analysis settings documented?
Wilcoxon Signed Rank Test Symbols
- = paired difference
- W+W^+ = sum of positive ranks
- W−W^- = sum of negative ranks
- TT = test statistic
- pp = p-value
- α\alpha = significance level
- rrbr_{rb} = rank-biserial correlation
Conclusion
The Wilcoxon Signed Rank Test is one of the most useful nonparametric methods for analyzing paired, matched, or one-sample data. It is particularly valuable when the normality assumption associated with a paired t-test is questionable but the paired differences remain reasonably symmetric.
The procedure calculates paired differences, ranks their absolute magnitudes, restores their signs, and evaluates whether positive and negative ranks are systematically unbalanced.
Although it is nonparametric, the test is not assumption-free. Researchers still need to consider the paired structure of the data, independence between pairs, symmetry, ties, zero differences, missing observations, sample size, and overall study design.
A strong analysis should also go beyond simply reporting:
p<0.05p < 0.05
Whenever possible, report the test statistic, p-value, usable sample size, descriptive statistics, effect size, confidence interval or location estimate, software method, and treatment of ties and zero differences.
When these factors are handled carefully, the Wilcoxon Signed Rank Test provides a practical and informative way to evaluate changes in paired data without requiring normally distributed differences.
FAQs About Wilcoxon Signed Rank Test
1. Can the Wilcoxon Signed Rank Test be used for Likert scale data?
Yes, the Wilcoxon Signed Rank Test can be considered for paired ordinal data such as Likert-scale responses when the observations can be meaningfully ranked.
2. Should I report the median and IQR with a Wilcoxon Signed Rank Test?
Median and interquartile range are commonly useful descriptive statistics because they summarize the center and spread without relying on normality.
3. What does W = 0 mean in a Wilcoxon Signed Rank Test?
A WW value of zero can occur when all usable signed ranks fall in the same direction under a particular statistic convention. Always check how your software defines WW.
4. What happens if all paired differences have the same sign?
If every usable difference is positive or every difference is negative, the data show complete directional agreement. The resulting p-value still depends on the sample size and calculation method.
5. Can the Wilcoxon Signed Rank Test be performed in Excel?
Excel does not provide a standard built-in Wilcoxon signed-rank function, but the calculation can be performed manually with ranks or through suitable statistical add-ins.
6. Should I report the median difference or difference between medians?
For paired data, the paired differences are more directly relevant than simply subtracting the two group medians. A rank-based location estimate can provide additional information about the paired change.
7. Can the Wilcoxon Signed Rank Test be used for paired A/B testing?
Yes, when the same users or matched units experience both A and B conditions and the assumptions of the test are appropriate.
8. Can percentage changes be analyzed with the Wilcoxon Signed Rank Test?
They can be analyzed when percentage change is scientifically meaningful, but researchers should check its distribution because percentage transformations can change symmetry and interpretation.