Mann–Whitney U: Compare Ranks, Not Means
An independent t-test compares the means of two groups. Mann–Whitney U asks a different question: whether observations from one independent group tend to rank above or below observations from the other. It is not simply a t-test with the normality assumption removed.
The test uses relative ordering
Combine the observations from both groups, rank them, and calculate the rank sum for each group. If values from the two groups occupy similar positions in the combined ranking, their rank sums should also be similar.
For group sizes n1 and n2, with rank sums R1 and R2:
U1 = n1 × n2 + n1 × (n1 + 1) / 2 - R1U2 = n1 × n2 + n2 × (n2 + 1) / 2 - R2
The smaller of U1 and U2 is commonly used as the test statistic. Statistical software then obtains a p-value from its exact or asymptotic distribution, depending on sample size and ties.
For a small example, let Group A contain [1, 3, 5] and Group B contain [2, 4, 6]. Their combined ranks alternate between the groups. The rank sums are R1 = 9 and R2 = 12, producing U statistics of 6 and 3; the smaller value is 3. The calculation uses ordering, so replacing the values with any monotonically transformed scale leaves the ranks unchanged.
When values are tied, they receive average ranks. Ties also affect the variance used by the asymptotic p-value, which is why hand calculations and software output can differ if tie correction or the exact/asymptotic method is not stated.
The hypotheses concern the distributions
- Null hypothesis: observations from the two populations have the same distribution, expressed by the test as neither group tending to produce larger values than the other.
- Alternative hypothesis: observations from one population tend to be larger or smaller than observations from the other.
If the two distributions have the same shape and spread, a location shift can be interpreted as a difference in medians. Without that condition, a significant result does not by itself prove that the medians differ; it may reflect another distributional difference.
This distinction is visible when one group is much more variable than the other. Their medians can be equal while observations from one distribution still occupy systematically different ranks. Plotting both distributions is therefore part of interpreting the test, not decoration after the p-value.
Use it for two independent groups
Mann–Whitney U is appropriate for two independent groups with an ordinal or continuous outcome when ranking is meaningful. It is not the non-parametric test for paired observations; paired data require a paired method such as the Wilcoxon signed-rank test.
Non-normality alone does not automatically require Mann–Whitney U. Welch’s t-test can still be useful for a mean comparison, especially with adequate sample sizes, while Mann–Whitney answers a rank-based distributional question. The test should follow the estimand: use the method that matches what the analysis is trying to compare.
Report magnitude, not only the p-value
Alongside the U statistic and p-value, report the group sizes, medians, interquartile ranges, and an effect size such as rank-biserial correlation or probability of superiority. State the direction convention used by the software, because implementations may attach U to different groups.
The final interpretation should remain narrow: one group tends to produce larger observations than the other under the sampling design. Causality still depends on how the groups were created, and a small p-value does not tell us whether the difference matters operationally.