Lably
Skip to content

Mann–Whitney U test

Nonparametric test of the null hypothesis

  • 18 min read
  • 11 chapters

Related on Lably

Through Statistical hypothesis test, Probability distribution and Independence (probability theory)

The value of U calculated by the test can be converted to a measure of effect size by dividing it by the maximum value of U, which is the product of the sizes of the two samples being compared. This measure is the probability that the value of a random observation from the higher group will be greater than that of a random observation from the lower group.

Nonparametric tests used on two dependent samples are the sign test and the Wilcoxon signed-rank test.

Assumptions and formal statement of hypotheses

Henry Mann and Donald Ransom Whitney developed the Mann–Whitney U test under the assumption of continuous responses with the alternative hypothesis being that one distribution is stochastically greater than the other. That is to say that the probability of a random observation from one group being larger than a random observation from the other group is 0.5. There are many other ways to formulate the null and alternative hypotheses such that the Mann–Whitney U test will give a valid test.

A very general formulation is to assume the following conditions:

  1. All the observations from both groups are independent of each other,
  2. The responses are at least ordinal (i.e., one can at least say, of any two observations, which is the greater),
  3. Under the null hypothesis H0, the distributions of both populations are identical.
  4. The alternative hypothesis H1 is that the distributions are not identical.

Under the general formulation, the test is only consistent when the following occurs under H1:

  1. The probability of an observation from population X exceeding an observation from population Y is different (larger, or smaller) than the probability of an observation from Y exceeding an observation from X; i.e., P(X > Y) ≠ P(Y > X) or P(X > Y) + 0.5 · P(X = Y) ≠ 0.5.

Under more strict assumptions than the general formulation above, e.g., if the responses are assumed to be continuous and the alternative is restricted to a shift in location, i.e., F1(x) = F2(x + δ), we can interpret a significant Mann–Whitney U test as showing a difference in medians. This practice relies on strict assumptions about the data distribution. When this assumption does not hold, it is simple to demonstrate that the test produces a statistically significant result when the medians of the two groups are in fact identical. If a test of medians is required, quantile regression explicitly tests this.

Under this location shift assumption, we can also interpret the Mann–Whitney U test as assessing whether the Hodges–Lehmann estimate of the difference in central tendency between the two populations differs from zero. The Hodges–Lehmann estimate for this two-sample problem is the median of all possible differences between an observation in the first sample and an observation in the second sample.

Otherwise, if both the dispersions and shapes of the distribution of both samples differ, the Mann–Whitney U test fails a test of medians. It is possible to show examples where medians are numerically equal while the test rejects the null hypothesis with a small p-value.

The Mann–Whitney U test / Wilcoxon rank-sum test is not the same as the Wilcoxon signed-rank test, although both are nonparametric and involve summation of ranks. The Mann–Whitney U test is applied to independent samples. The Wilcoxon signed-rank test is applied to matched or dependent samples.

Sign in to keep reading

10 more chapters are free with a Lably account.

More in Statistics