Chapter 09: Hypothesis Testing

Compare observed evidence with a chance model.

Which outcomes would be unusual if the stated model were true?

Learning Goals

  1. State null and alternative hypotheses for a data question.
  2. Choose a test statistic that measures the relevant difference.
  3. Simulate a null distribution for a test statistic.
  4. Interpret p-values as evidence against a chance model.
  5. Make decisions while separating statistical evidence from practical importance.

Chapter Flow

Case Statistic Evidence against the model
Promotions: 40% of eligible staff are women Women among 50 promoted Small counts
Survey: customer-base age shares Total variation distance Large distances
A/B tool: 50% of visitors to B Absolute distance from 50% Large distances

A two-sided alternative can use a right-tail distance statistic.

What To Watch For

  • Keep the model and sample size fixed. Draw a new sample each time.
  • Count simulated statistics at least as extreme as observed.
  • Divide by repetitions to estimate the p-value.
  • Apply the significance level chosen before seeing the result.

Zero extreme simulations means none were seen in that run. It does not establish zero probability.

Carry Forward

A checkout change has p = 0.003 and an estimated gain of 0.02 percentage points.

  • 100,000 monthly visits imply 20 extra purchases.
  • At $10 contribution each, the estimated gain is $200.
  • A $1,000 monthly operating cost exceeds that gain.

Statistical evidence alone does not establish business value. Report the estimated effect and its uncertainty too.