Mann–Whitney U test
The non-parametric alternative to the independent t-test, for non-normal or ordinal data.
6 min read
Try it
One click opens the “Exam scores” sample dataset with this test selected and the variables filled in. Or use your own data.
The Mann–Whitney U test (also called the Wilcoxon rank-sum test) is the non-parametric alternative to the independent t-test. It compares two independent groups using the ranks of the data instead of the raw values, so it does not assume normality.
When to use it
- You are comparing two independent groups, and
- the outcome is ordinal, such as a single Likert item, or
- the outcome is numeric but not normal with small groups (fewer than 30 per group), or has severe outliers.
When the data are normal, the independent t-test has more power. Lucidstat tells you when every group looks approximately normal.
The idea
- Pool both groups and rank all values from lowest to highest; tied values share the average rank.
- Add up the ranks in each group.
- If the groups do not differ, their mean ranks should be similar. If one group has much higher ranks, it tends to have higher values.
The U statistic counts how often values in one group fall below values in the other. Lucidstat converts U to z (with tie and continuity corrections, as R wilcox.test) and reports the effect size r = |z| ÷ √N (Rosenthal, 1991).
Worked example
The "Exam scores" sample compares anxiety (a single 1–5 item, so ordinal) between groups A and B, 20 students each.
| Group | n | Mdn | Q1 | Q3 | Mean rank |
|---|---|---|---|---|---|
| A | 20 | 3.00 | 2.00 | 3.00 | 19.95 |
| B | 20 | 3.00 | 2.00 | 4.00 | 21.05 |
Result: U = 189, z = −0.32, p = .763, r = .05.
How to read it
- p = .763 is above .05: anxiety does not differ significantly between the groups.
- The mean ranks are very close (19.95 and 21.05), and r = .05 is below the "small" benchmark of .10.
- Report medians and quartiles rather than means and SDs, because the test works on ranks.
A Mann–Whitney U test showed no significant difference in Anxiety between A (Mdn = 3.00) and B (Mdn = 3.00), U = 189, z = −0.32, p = .763, r = .05.
ผลการทดสอบ Mann–Whitney U พบว่า ความวิตกกังวลของ A (Mdn = 3.00) และ B (Mdn = 3.00) ไม่แตกต่างกันอย่างมีนัยสำคัญทางสถิติ (U = 189, z = −0.32, p = .763)
Common mistakes
- Using it for repeated measurements on the same people. Use the Wilcoxon signed-rank test.
- Reporting means alongside a Mann–Whitney test. Report medians and mean ranks.
- Switching to Mann–Whitney whenever Shapiro–Wilk fails, even with large samples. See Assumptions.
References
- Mann, H. B., & Whitney, D. R. (1947). On a test of whether one of two random variables is stochastically larger than the other. The Annals of Mathematical Statistics, 18(1), 50–60.
- Rosenthal, R. (1991). Meta-analytic procedures for social research (Rev. ed.). Sage.
Try it
One click opens the “Exam scores” sample dataset with this test selected and the variables filled in. Or use your own data.