Data and statistics · cheat sheet

Mann-Whitney test

A test of whether two independent groups differ, using the ranks of all values instead of their averages.

Common practice
4 steps
Used by Process Improvement Specialist

What it is

The Mann-Whitney test ranks all values from two groups together and checks whether one group's ranks are generally higher.

When to use it

When comparing two groups with skewed data, small samples or ordinal data.

Why it works

It compares two groups without assuming normal data.

Do

  • Report medians alongside the p-value.

Don't

  • Using it on paired data (use Wilcoxon on the differences).
  • Assuming it compares medians when the groups' shapes are very different.

Step by step

  1. Rank all together
  2. Rank sums
  3. U statistic
  4. p-value
Also called: Wilcoxon rank-sum testPrint the blank template ↗

Worked example

The situation. Repair times (hours) at two depots, 8 jobs each.

  1. Medians 14.5 and 10.

The result. The slower depot was missing a common spare part.

Mann-Whitney worksheet Print blank
PartValue
U59.5
p-value0.004

Filled in for: Repair times (hours) at two depots, 8 jobs each.

ValueGroupRank

Copy this structure, or print the blank version and fill it in by hand. Rank sum group 1 ______ group 2 ______ U = rank sum − n(n + 1) ÷ 2

Before you use it: check these

CheckIf it fails
Independent groupsFor paired data, use Wilcoxon on the differences
Groups with a similar shape, if you want to compare mediansOtherwise it compares whether one group tends to be higher

How to do it with real data

The full calculation, as it happens in the story: the data, every step, how to read the result, and the spreadsheet functions to do it yourself.

Worked example with real data

Did something change at week 12?

From Day 30: What happened in week 12? of the Process Improvement Specialist story

The run chart showed a shift at week 12. The rota shows one doctor cut from five sessions a week to three that week, and the sessions were never covered. Astrid (Data Analyst) compares the weekly median waits before and after.

Weekly median waits before and after week 1205101520Before: median 8, quartiles 8 and 9, n = 118BeforeAfter: median 12, quartiles 11 and 12, n = 912After

Step by step

  1. Describe each groupbefore (11 weeks): mean 8.27, s 0.65 · after (9 weeks): mean 11.56, s 1.13
  2. Equal spreads? (F-test)F = 1.13² ÷ 0.65²; p = 0.10, and Levene's test p = 0.15= no evidence of different spreads
  3. Two-sample t-testt = (11.56 − 8.27) ÷ (0.895 × √(1/9 + 1/11))= 8.16
  4. p-value18 degrees of freedom= below 0.0001
  5. Check without assuming normal dataMann-Whitney: every week after is higher than every week before (U = 99 of 99)= p = 0.0001
  6. Size of the change11.56 − 8.27= about 3.3 days longer
WeekPeriodMedian wait (days)
Week 1Before8
Week 2Before9
Week 3Before8
Week 4Before7
Week 5Before9
Week 6Before8
Week 7Before9
Week 8Before8
Week 9Before8
Week 10Before9
Week 11Before8
Week 12After10
Week 13After10
Week 14After11
Week 15After11
Week 16After12
Week 17After12
Week 18After13
Week 19After12
Week 20After13

How to read the result

Since week 12 the weekly median wait is about 3.3 days longer, and it's very unlikely to be chance. The timing matches the lost doctor sessions.

What it led to

Root cause confirmed: about 30 routine appointments a week were lost at week 12 and never replaced.

Do it in a spreadsheet

F-test p-value=F.TEST(C2:C12,C13:C21)
t-test p-value (equal variances)=T.TEST(C2:C12,C13:C21,2,2)
Unequal variances version=T.TEST(C2:C12,C13:C21,2,3)
Mann-Whitneyrank all 20 values with RANK.AVG and add each group's ranks; no built-in p-value
Try it yourself: If the F-test had shown clearly different spreads, which version of the t-test would you use?

The unequal-variances version (often called Welch's t-test): =T.TEST(…,2,3). Here it also gives p below 0.0001.

In the roles

How a Process Improvement Specialist uses it

Weekly medians before and after week 12: every week after is higher, U = 99, p = 0.0001.

Questions people ask

Is it the same as Wilcoxon rank-sum?

Yes, two names for equivalent tests.

Related techniques

← All techniques and tools