Skip to main content

Mann-Whitney U test

The Mann-Whitney U test compares two independent groups by jointly ranking all observations and testing whether one group tends to produce higher values.

ByHoang TruongUpdated

FrameworkNon-parametric tests

See it move

Loading infographic...

Wait times at two branches (n = 8, n = 7) are ranked together, lowest to highest, across all fifteen observations. Branch A's ranks sum to 90, giving U₁ = 90 − 36 = 54; branch B's sum to 30, giving U₂ = 30 − 28 = 2. The two U values total 56, matching n₁n₂, while the expected U under equal distributions is only 28.

Where it fits
SubjectData Analysis & StatisticsAdvancedTopicCommon Significance TestsAdvanced

The formula

LaTeX
U1=R1n1(n1+1)2U_1 = R_1 - \frac{n_1(n_1 + 1)}{2}

Variables

Mann-Whitney U statistic for group 1 (dimensionless)
sum of ranks assigned to group 1 observations in the joint ranking of all n₁ + n₂ observations (dimensionless)
sample size of group 1 (dimensionless)

U₁ + U₂ = n₁n₂. Compute U for both groups; U₁ counts all (group 1, group 2) pairs where the group 1 value exceeds the group 2 value.

LaTeX
E(U)=n1n22E(U) = \frac{n_1 n_2}{2}

Variables

expected value of U under the null hypothesis (dimensionless)
sample size of group 1 (dimensionless)
sample size of group 2 (dimensionless)

Under H₀ each group's observations are equally likely to rank higher; U is symmetric around n₁n₂/2.

Check yourself

PracticeCORE

A researcher compares job satisfaction scores (rated 1–10) between employees at two independent sites: Site A (n = 8) and Site B (n = 9). Histograms for both groups show strong right-skew. Which test is most appropriate, and why?

Select an answer to check your understanding.
Mann-Whitney U test — Edlintics Glossary