Day 28 of 55Stage 3 · AnalyseWednesdayHypothesis testing

Real, or just chance?

Every comparison will show some difference. Amara learns the logic that decides whether a difference is real.

Stage goal: Find and prove the root causes.
Stakeholders
Augustin (Black Belt)
Documents today Analysis record
How the day goes
  1. 09:00Hypothesis testing with Augustin (Black Belt)
  2. 11:00Test the gap to the target
  3. 15:00Plan the tests ahead with Augustin (Black Belt)

Situation 1 of 2

09:00 · Hypothesis testing with Augustin (Black Belt)
Augustin (Black Belt)mentor
In a test, you assume nothing is going on, then see how surprising your data would be. What's that assumption called?

Which is right?

A test starts from the null hypothesis (no difference). A small p-value means the data would be surprising if it were true.

Situation 2 of 2

15:00 · Plan the tests ahead with Augustin (Black Belt)
Augustin (Black Belt)mentor
Two ways to be wrong: seeing a difference that isn't there, or missing one that is. Which worries you more here?

How do you manage both risks?

Alpha is the risk of a false alarm, beta the risk of missing a real difference. Plan the sample size for both.
Worked example 1

How much data does a test need?

Before comparing two groups, Amara wants an 80% chance of detecting a 3-day difference in waits, if it's real. The waits' standard deviation is about 6.5 days; alpha is 0.05.

InputValue
Difference worth detecting3 days
Standard deviation6.5 days
Alpha (two-sided)0.05 (z = 1.96)
Power wanted80% (z = 0.84)
Download the data (spreadsheet file)
  1. Formula (two groups)n per group = 2 × (z for alpha + z for power)² × s² ÷ difference²
  2. Fill in2 × (1.96 + 0.84)² × 6.5² ÷ 3²= 73.7
  3. Round up= 74 per group
  4. What 30 per group would givepower = chance of detecting it: Φ(3 ÷ (6.5 × √(2/30)) − 1.96)= 43%
  5. Check at 74Φ(3 ÷ (6.5 × √(2/74)) − 1.96)= 80%
What it meansWith 30 per group, a real 3-day difference would be missed more than half the time. A “not significant” result from too little data proves nothing.
What Amara decidesPlan comparisons of individual waits with at least 74 per group, or compare weekly figures that vary less, as the team does for week 12.
Try it yourself in a spreadsheet
Sample size=ROUNDUP(2*(NORM.S.INV(0.975)+NORM.S.INV(0.8))^2*6.5^2/3^2,0)
Power for n = 30=NORM.S.DIST(3/(6.5*SQRT(2/30))-NORM.S.INV(0.975),TRUE)

How many per group to detect a 2-day difference with the same spread?

Show the answer

2 × 2.8² × 6.5² ÷ 2² = 165.6, so 166 per group. Smaller differences need far more data.

Worked example 2

Is the average wait really above 7 days?

Atticus (Sponsor) asks whether the wait could really be 7 days on average and the sample is just unlucky. Amara tests it.

InputValue
Sample size60
Sample mean10.43 days
Standard deviation6.46 days
Value tested7 days
Significance level (alpha)0.05
Download the data (spreadsheet file)
  1. HypothesesH0: the true mean is 7 days. H1: it is more than 7
  2. Choose the testcontinuous data, one group, compared with a value; 60 records, so averages are close to normal= one-sample t-test
  3. Test statistict = (mean − 7) ÷ (s ÷ √n) = (10.43 − 7) ÷ 0.834= 4.11
  4. p-valuechance of a mean this high if the truth were 7= 0.00006
  5. Decidep is below 0.05: reject H0
  6. Practical size3.4 days above the target matters to patients= statistically and practically significant
What it meansA sample mean this far above 7 would almost never happen by chance if the real average were 7. The difference is also big enough to matter to patients.
What Amara decidesThe gap to the target is real. The project moves on to finding which causes create it.
Try it yourself in a spreadsheet
t statistic=(AVERAGE(B2:B61)-7)/(STDEV.S(B2:B61)/SQRT(60))
p-value (one-sided)=T.DIST.RT(D2,59)

With a sample of 2,000 a test finds the mean wait is 7.1 days, p = 0.01, against a target of 7. Is it a problem worth a project?

Show the answer

It's statistically significant but practically tiny: 0.1 day. Large samples make small differences significant. Always ask whether the size of the difference matters.

Key concepts

The ideas behind today. Concept how the work is done, in our own words · Common practice widely used ways of working.

Concept

The logic of a test

  • Assume no difference (the null hypothesis). Calculate how surprising the data would be if that were true: the p-value. Below 0.05, reject the null hypothesis.

Where you will meet this: Null and alternative hypotheses · p-value

Concept

Two risks

  • Alpha: a false alarm, seeing a difference that isn't there (usually 5%). Beta: missing a real difference. Power (1 − beta), usually 80%, depends on sample size, spread and the size of the difference you care about.

Where you will meet this: Alpha and beta risk · power · sample size

Concept

Statistical and practical significance

  • A significant result says the difference is probably real, not that it matters. Always ask whether the size of the difference is worth acting on.

Explained in our own words. This helps you understand the concepts behind the certifications; it does not reproduce or replace any official guide. Sources

Day 28 complete

2 situations today.

Your responsibility todayTesting whether differences are real
Technique you usedHypotheses, p-values, alpha and beta, one-sample t-test
Key points to remember
  • A test starts from the null hypothesis (no difference). A small p-value means the data would be surprising if it were true.
  • Alpha is the risk of a false alarm, beta the risk of missing a real difference. Plan the sample size for both.
Documents today Analysis record