How to use
- Choose Mann–Whitney U and paste one column per group. A header row is optional.
- For a one-sided test, pick "first column is larger" or "smaller" under the alternative hypothesis.
- Read the p-value, and compare the medians and mean ranks to see which group is higher.
- For three or more groups, choose Kruskal–Wallis and paste one column per group.
Options explained
- U and W
- U counts how often a value in one group beats a value in the other (ties count half). SPSS reports the smaller U; R's W is U for the first group. Both are shown and give the same p-value.
- Exact vs approximate p
- With both groups under 50 and no tied values, the p-value comes from the exact distribution. Otherwise it uses the normal approximation with tie and continuity corrections, R's wilcox.test() default.
- Effect size
- r = |z| / √N, with 0.1, 0.3 and 0.5 as rough small, medium and large. The rank-biserial correlation runs from −1 to 1 and is positive when the first group tends to be larger.
Worked example
The sample has two groups of nine values:
| Group | n | Median | Mean rank |
|---|---|---|---|
| A | 9 | 1.68 | 11.44 |
| B | 9 | 1.07 | 7.56 |
U = 23 (R’s W = 58), z = 1.55. Both groups are under 50 with no ties, so the exact distribution is used: two-sided p = 0.136, not significant, r = 0.36. If you had predicted beforehand that A would be larger, the one-sided p is 0.068, still not significant.
APA style: U = 23.0, z = 1.55, p = .136, r = .36.
Which test to use
| Situation | Test |
|---|---|
| Two independent groups, roughly normal data | Independent t-test |
| Two independent groups, small and skewed, or ratings (such as 1–5 satisfaction) | Mann–Whitney U |
| The same people measured twice | Paired t-test or Wilcoxon signed-rank |
| Three or more groups, roughly normal | One-way ANOVA |
| Three or more groups, skewed or ordinal | Kruskal–Wallis H |
The test ranks all values together and compares the ranks of the two groups, so outliers can’t dominate it. The cost is slightly less power than the t-test when the data really are normal.
Frequently asked questions
Are Mann–Whitney U and Wilcoxon rank-sum the same test?
Yes. The statistic is written differently but the p-value is identical. Don't confuse it with the Wilcoxon signed-rank test, which is for paired data.
Does it compare medians?
Strictly, it tests whether values in one group tend to be larger than in the other. If the two distributions have a similar shape, you can read it as a difference in medians.
Why does SPSS give a different p-value?
By default SPSS shows the asymptotic p (normal approximation without continuity correction). For small samples tick "Exact" in SPSS and the results match.
How do I follow up a significant Kruskal–Wallis test?
Run Mann–Whitney tests on each pair and adjust the p-values, for example with Bonferroni. With three pairs, multiply each p by 3.
Privacy
This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.