Kruskal-Wallis test
Rank-based test of whether a skewed measurement or an ordered score differs between three or more independent groups.
Clinical example
A pain score at discharge compared between patients who had one of three types of surgery.
When to use it
- The outcome is a skewed measurement or an ordered score.
- You compare three or more groups, and each patient is in only one of them.
- You don't need to adjust for other variables.
Assumptions to check
Independent observations
One value per patient. Repeated measurements or clustered patients need a mixed model.
What to report
- Median with interquartile range per group
- The overall p-value
- Pairwise comparisons, adjusted for multiple comparisons
Common mistakes
Don't run many separate tests
Testing every pair of groups, outcome or time point separately piles up false positives. Use one model, prespecify the main comparison, and correct for multiple comparisons where needed.
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 |
|---|---|
| Roughly symmetric data or larger groups | One-way ANOVA |
| Ordered score and you need to adjust for other variables | Proportional odds (ordinal logistic) regression |
In your software
# R
kruskal.test(pain ~ surgery, data = trial)
pairwise.wilcox.test(trial$pain, trial$surgery, p.adjust.method = "holm")
NPTESTS
/INDEPENDENT TEST (pain) GROUP (surgery) KRUSKAL_WALLIS(COMPARE=PAIRWISE).