Wilcoxon signed-rank test
Compares paired measurements using the ranks of the within-patient differences, for skewed differences or ordered scores.
Clinical example
A pain score from 0 to 10 recorded before and after a physiotherapy course in the same patients.
When to use it
- The same patients are measured twice, or you have matched pairs.
- The outcome is an ordered score, or the differences are skewed and there are few pairs.
- You don't need to adjust for other variables.
Assumptions to check
Pairs are independent of each other
Each patient contributes one pair. Several pairs per patient need a mixed model.
Differences symmetric around the median
Look at a histogram of the within-patient differences. The test assumes they are roughly symmetric.
What to report
- Median with interquartile range at each time point
- Pseudo-median of the differences with 95% CI
- The exact p-value, not just "p < 0.05"
Common mistakes
Paired data need a paired test
Measurements in the same patient are related. An unpaired test ignores that and loses power, or gives the wrong answer.
Be careful treating a score as a measurement
The steps of an ordinal score aren't necessarily equal. Means and t-tests assume they are.
Alternatives
| If your situation is… | Use |
|---|---|
| Differences roughly symmetric | Paired t-test |
In your software
# R (second minus first)
wilcox.test(trial$pain_after, trial$pain_before, paired = TRUE, conf.int = TRUE)
NPAR TESTS
/WILCOXON=pain_after WITH pain_before (PAIRED).