Instant PDF download, name-and-email checkout. Complete Book Bundle: every Economics, Statistics, Mathematics, Econometrics and Research Methods book
Statistics

Mann–Whitney U Test: Step-by-Step Example, Ties and the Normal Approximation

The Mann–Whitney U test step by step: ranking two independent groups, calculating U, critical values, ties, the normal approximation and how to report it.

In 30 seconds
  • The Mann–Whitney U test compares two independent groups when you cannot assume normal data. It is the non-parametric alternative to the independent-samples t-test.
  • Rank all the data together, add up the ranks in each group, and convert to \(U\).
  • \(U_1 = R_1 – \dfrac{n_1(n_1+1)}{2}\), \(U_2 = n_1 n_2 – U_1\). The test statistic is the smaller \(U\).
  • Reject \(H_0\) if the smaller \(U\) is less than or equal to the critical value.
  • For larger samples, use a normal approximation.

The problem: small, skewed samples

A student compares two revision methods with six and seven volunteers. The scores are not normally distributed, and one person scored far above the rest. A t-test would be unreliable. The Mann–Whitney U test, published by Henry Mann and Donald Whitney in 1947[1], avoids the normality assumption by working with ranks. It is one of the most widely used tests in dissertations, coursework and the IB Extended Essay.

Key ideas

Key termMann–Whitney U test (also called the Wilcoxon rank-sum test): a test of whether values in one independent group tend to be larger than values in another. Null hypothesis: the two populations have the same distribution. Alternative: one tends to give larger values than the other.

Assumptions: the two samples are independent, the observations within each are independent, and the outcome is at least ordinal. If the two distributions have a similar shape, the test can be read as comparing medians[2].

Statistics Made Simple textbook coverStatistics Made Simple explains parametric and non-parametric tests side by side, with worked examples and tables.Get the textbook · $15

Worked example

Worked example

Students learned a word list using method A (6 students) or method B (7 students). Words recalled:
A: 14, 18, 11, 20, 16, 22
B: 9, 12, 8, 15, 10, 13, 7
Test at the 5% level (two-tailed) whether the methods differ.

Step 1Hypotheses: \(H_0\): recall scores have the same distribution for both methods. \(H_1\): one method tends to give higher scores.
Step 2Rank all 13 values together, smallest = 1: 7(1), 8(2), 9(3), 10(4), 11(5), 12(6), 13(7), 14(8), 15(9), 16(10), 18(11), 20(12), 22(13).
Step 3Sum of ranks: A gets 8 + 11 + 5 + 12 + 10 + 13 = 59. B gets 3 + 6 + 2 + 9 + 4 + 7 + 1 = 32. Check: total should be \(13 \times 14 / 2 = 91\), and \(59 + 32 = 91\).
Step 4\(U_A = 59 – \dfrac{6 \times 7}{2} = 59 – 21 = 38\). \(U_B = 6 \times 7 – 38 = 4\). Test statistic \(U = 4\).
Step 5Critical value for \(n_1 = 6\), \(n_2 = 7\), 5% two-tailed: 6. Since \(4 \le 6\), reject \(H_0\). (Software gives an exact \(p = 0.014\).)

Conclusion: there is evidence that recall differs between the methods; method A scores tend to be higher (median 17 words vs 10). With small groups, report the medians alongside the test.

Common mistakeRejecting \(H_0\) when \(U\) is larger than the critical value. For Mann–Whitney it is the other way round: a small U means the groups barely overlap, which is evidence against \(H_0\).
Statistics Practice Questions coverDrill t-tests, Mann–Whitney, Wilcoxon and chi-square with 1,569 fully worked questions.Get 1,569 questions · $9

Ties and larger samples

Tied values get the average of the ranks they span, exactly as with Spearman’s coefficient. For samples larger than about 20 in each group, U is approximately normal with

\[ \mu_U = \frac{n_1 n_2}{2}, \qquad \sigma_U = \sqrt{\frac{n_1 n_2 (n_1 + n_2 + 1)}{12}}, \qquad z = \frac{U – \mu_U}{\sigma_U} \]

For example, with 20 in each group and \(U = 120\): \(\mu_U = 200\), \(\sigma_U = \sqrt{20 \times 20 \times 41 / 12} = 36.97\), so \(z = -2.16\) and the two-tailed \(p = 0.031\).

Reporting it

A typical write-up reads: “Recall was higher with method A (Mdn = 17) than method B (Mdn = 10), U = 4, p = .014.” Add an effect size if your course asks for one; a common choice is \(r = z/\sqrt{N}\).

Exam tipQuestions often ask you to justify the test. Mention all three points: the groups are independent, the samples are small, and the data are skewed or ordinal, so a t-test’s normality assumption is doubtful.

Free help or the books

To see where this test fits, use our decision table and flowchart, and for the parametric version read paired vs independent t-test. The Statistics Made Simple textbook covers every test by hand; the Research Methods Made Simple textbook shows how to run and report them in a dissertation with SPSS, R and Python.

Research Methods Made Simple bundle coverRunning tests for a dissertation? Both Research Methods Made Simple books for $19.Both books · $19Complete Book Bundle coverEvery Made Simple book (economics, statistics, mathematics, econometrics and research methods): the Complete Book Bundle for $59 (was $132).Complete Book Bundle · $59

Practice questions

EasyQ1. When should you use the Mann–Whitney U test instead of an independent t-test? Show worked answer
When the two groups are independent but the data are clearly non-normal, contain outliers, are ordinal (such as ratings), or the samples are small.
EasyQ2. Two groups of 5 have rank sums 36 and 19. Find both U values and the test statistic. Show worked answer
\(U_1 = 36 – 15 = 21\); \(U_2 = 25 – 21 = 4\) (check: \(19 – 15 = 4\)).
Test statistic \(U = 4\).
MediumQ3. Group X: 3, 7, 8, 12. Group Y: 5, 10, 14, 15, 18. Calculate U. Show worked answer
Ranks: 3(1), 5(2), 7(3), 8(4), 10(5), 12(6), 14(7), 15(8), 18(9).
\(R_X = 1 + 3 + 4 + 6 = 14\). \(U_X = 14 – 10 = 4\). \(U_Y = 20 – 4 = 16\).
U = 4.
MediumQ4. For \(n_1 = n_2 = 25\) and \(U = 200\), use the normal approximation to find z. Show worked answer
\(\mu_U = 312.5\); \(\sigma_U = \sqrt{25 \times 25 \times 51 / 12} = \sqrt{2656.25} = 51.54\).
\(z = (200 – 312.5)/51.54 = -2.18\); two-tailed \(p \approx 0.029\).
ExamQ5. A researcher compares customer satisfaction ratings (1–10) at two independent branches: 8 customers at branch P and 9 at branch Q. She finds U = 15. The 5% two-tailed critical value is 15. (a) Justify the choice of test. (b) State the hypotheses and conclusion. (c) Suggest one improvement. [6 marks] Show worked answer
(a) Ratings are ordinal and the branches are independent groups with small samples. [2]
(b) \(H_0\): satisfaction distributions are the same at both branches; \(H_1\): they differ. [1] \(U = 15 \le 15\), so reject \(H_0\) at 5%: satisfaction differs between branches. [2]
(c) Use a larger, randomly selected sample of customers, or collect ratings over several days. [1]

Frequently asked questions

Is Mann–Whitney the same as the Wilcoxon rank-sum test?

Yes, they are equivalent tests that use slightly different statistics. The Wilcoxon signed-rank test is different: it is for paired data.

Does Mann–Whitney compare medians?

Only if the two distributions have a similar shape. In general it tests whether values in one group tend to be larger than in the other.

Which U do I compare with the table?

The smaller of the two. Most tables give the largest U that is still significant.

References

  1. Mann, H. B. and Whitney, D. R. (1947) ‘On a test of whether one of two random variables is stochastically larger than the other’, Annals of Mathematical Statistics, 18(1), pp. 50–60. https://doi.org/10.1214/aoms/1177730491
  2. Hart, A. (2001) ‘Mann–Whitney test is not just a test of medians: differences in spread can be important’, BMJ, 323(7309), pp. 391–393. https://doi.org/10.1136/bmj.323.7309.391
  3. Wilcoxon, F. (1945) ‘Individual comparisons by ranking methods’, Biometrics Bulletin, 1(6), pp. 80–83. https://doi.org/10.2307/3001968
Statistics Made Simple Complete Bundle cover showing both the textbook and practice book
This topic has a full chapter in Statistics Made Simple, with 1,569 worked practice questions in the bundle.Statistics Made Simple Complete Bundle — Textbook + 1,569 Practice Questions
Get it for $19
E

The EconTutorials team writes clear, exam-focused lessons in economics and statistics for A-Level, IB, AP and university students, with more than 13 years of classroom teaching behind every guide and book in the Made Simple series.