Skip to content
Celeus

Mann-Whitney U test

Shown in the app as mann_whitney. Part of the method reference, under Comparing groups.

When to use

Two independent groups, continuous/ordinal outcome, non-normal.

What you provide

  • Outcome: one numeric column.
  • Group: one categorical column with exactly two groups.

Options

Missing data

  • Complete case (listwise deletion)
  • Mean imputation (single)
  • Median imputation (single)

Multiple comparisons

  • Not adjustable for this method. Where it makes post-hoc comparisons, the procedure applies its own correction.

Confidence level

Every interval in the result is reported at the level you choose:

  • 90%
  • 95%
  • 99%

Alternative hypothesis

Two-sided unless you choose otherwise. Choose a one-sided test only when the direction was specified before the data were seen; the result then says so.

  • Two-sided: the first differs from the second in either direction
  • One-sided: the first is lower than the second
  • One-sided: the first is higher than the second

Alternatives that take the same inputs:

Other methods under Comparing groups:

Guides that discuss this method

How to read the output

These methods compare one outcome between two independent groups, for example reading scores under two teaching methods, or plant height under two fertilisers.

Welch’s and Student’s t-tests. The estimate is the difference in group means, with the direction stated (first group minus second). Read it with its 95% confidence interval: the interval is the range of differences compatible with your data, and an interval that excludes 0 corresponds to p below 0.05. The p-value is the probability of a difference at least this large if the two population means were equal; it does not measure how large or important the difference is. The effect size is Cohen’s d, the mean difference in standard-deviation units. Cohen’s benchmarks of 0.2, 0.5 and 0.8 for small, medium and large are a rough guide, not a rule (Cohen, 1988).

Welch’s test does not assume equal variances, which is why it is the default. When the variances really are equal it loses very little compared with Student’s test (Delacre, Lakens and Leys, 2017).

Mann-Whitney U test. This rank test asks whether values in one group tend to be larger than values in the other. It is a test of medians only when the two distributions have the same shape. The estimate is the Hodges-Lehmann shift, the median of all differences between a value from one group and a value from the other, with its confidence interval. The effect size is the rank-biserial correlation, from -1 to 1, where 0 means neither group tends to be larger (Kerby, 2014).

Sources: Cohen J (1988), Statistical Power Analysis for the Behavioral Sciences, 2nd ed., Lawrence Erlbaum. Delacre M, Lakens D, Leys C (2017), International Review of Social Psychology 30(1):92-101, doi:10.5334/irsp.82. Kerby DS (2014), Comprehensive Psychology 3, doi:10.2466/11.IT.3.1.

Worked examples

Celeus's result on a published or illustrative dataset, next to an independent computation and, where one exists, a published value. The data themselves are not reproduced here.

datasets::airquality

  • Source: Published dataset distributed with an R package
  • Licence: base R (GPL)
  • Reference: Chambers et al. (1983), Graphical Methods for Data Analysis
QuantityCeleusIndependent computationPublished valueAgrees
p-value6.10874e-056.10874e-05-Yes

chorioamnion permeability, 10 vs 5 (stats::wilcox.test help example)

  • Source: Published dataset distributed with an R package
  • Licence: base R (GPL)
  • Reference: Hollander & Wolfe (1973), Nonparametric Statistical Methods, p. 69
QuantityCeleusIndependent computationPublished valueAgrees
Test statistic3535-Yes
p-value0.1272060.127206-Yes
Estimate0.3050.305-Yes
Lower confidence limit-0.08-0.08-Yes

datasets::mtcars (am coded 0/1)

  • Source: Published dataset distributed with an R package
  • Licence: base R (GPL)
  • Reference: Henderson & Velleman (1981), Biometrics 37(2)
QuantityCeleusIndependent computationPublished valueAgrees
Test statistic4242-Yes
p-value0.001159010.00115901-Yes
Estimate-6.8-6.8-Yes
Confidence interval-12.6, -1.7-12.6, -1.7-Yes

datasets::chickwts (horsebean vs linseed)

  • Source: Published dataset distributed with an R package
  • Licence: base R (GPL)
  • Reference: Anonymous (1948), Biometrika 35
QuantityCeleusIndependent computationPublished valueAgrees
Test statistic2020-Yes
p-value0.007144560.00714456-Yes
Estimate-60.5-60.5-Yes
Confidence interval-105, -12-105, -12-Yes

datasets::chickwts (horsebean vs linseed)

  • Source: Published dataset distributed with an R package
  • Licence: base R (GPL)
  • Reference: Anonymous (1948), Biometrika 35
QuantityCeleusIndependent computationPublished valueAgrees
Test statistic2020-Yes
p-value0.007144560.00714456-Yes
Estimate-60.5-60.5-Yes
Confidence interval-120, -1-120, -1-Yes
Achieved confidence level of the interval0.9910430.991043-Yes

Validation report

References

  1. 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: 50-60. doi:10.1214/aoms/1177730491 doi:10.1214/aoms/1177730491
  2. Hodges, J. L., Lehmann, E. L. (1963). Estimates of location based on rank tests. The Annals of Mathematical Statistics 34: 598-611. doi:10.1214/aoms/1177704172 doi:10.1214/aoms/1177704172