Mann-Whitney U test
Compares a skewed measurement or an ordered score between two independent groups using ranks instead of raw values.
Clinical example
Length of stay in days compared between two wards. A few patients stayed very long, so the values are strongly skewed. Each patient was on one ward only.
When to use it
- The outcome is a skewed measurement or an ordered score such as a pain score.
- You compare exactly two 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.
It compares whole distributions
The test asks whether values in one group tend to be higher than in the other. It is a comparison of medians only when the two distributions have a similar shape.
Check first
- Consider a log transform first if the data are right-skewed and you also plan regression analyses; keep one approach throughout the paper
What to report
- Median with interquartile range per group
- Hodges-Lehmann estimate of the shift with 95% CI
- The exact p-value, not just "p < 0.05"
Common mistakes
Don't run a normality test to decide
With small samples it rarely flags a problem; with large ones it flags harmless deviations. Look at the histograms and think about the measurement instead.
Report the effect, not just the p-value
Give the estimate (difference, ratio) with its 95% confidence interval and the exact p-value.
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.
Don't dichotomize a measurement
Cutting a continuous variable into high and low ("BP above 140") throws away information and power, and the cut-off is often arbitrary.
Alternatives
| If your situation is… | Use |
|---|---|
| Roughly symmetric data or larger groups | Welch's t-test |
| Ordered score and you need to adjust for other variables | Proportional odds (ordinal logistic) regression |
In your software
# R
wilcox.test(los_days ~ ward, data = trial, conf.int = TRUE)
NPTESTS
/INDEPENDENT TEST (los_days) GROUP (ward) MANN_WHITNEY.