Topic 6 of 7
Step 17: Statistics and probability
Hypothesis tests
Step 17 · Statistics and probability topics
Set up a test of a claim, compute a test statistic and its p-value, and draw a conclusion while keeping the two kinds of error in mind.
Null and alternative hypotheses
A test weighs evidence against a default claim. The null hypothesis H₀ says nothing unusual is going on, usually that a parameter equals a set value. The alternative Hₐ is what you suspect instead: greater, less, or simply different.
Example: Setting up
A cereal maker claims its boxes hold 500 g on average. A watchdog suspects they hold less. State the hypotheses.
- H₀: μ = 500.
- Hₐ: μ < 500, a one-sided test.
AnswerH₀: μ = 500 g and Hₐ: μ < 500 g
Example: Two-sided
Is a coin fair? State the hypotheses for p, the chance of heads.
- H₀: p = 0.5.
- Hₐ: p ≠ 0.5, since a bias either way counts.
AnswerH₀: p = 0.5 and Hₐ: p ≠ 0.5
Test statistics and p-values
The test statistic measures how far the sample result is from what H₀ predicts, in standard errors. The p-value is the probability, if H₀ were true, of a result at least as extreme as the one observed. A small p-value is evidence against H₀.
Example: Cereal boxes
A sample of 36 boxes has mean 495 g, and σ = 12 g. Find the test statistic and p-value for Hₐ: μ < 500.
- SE = 12 ÷ 6 = 2.
- z = (495 − 500) ÷ 2, which is −2.5.
- The area below z = −2.5 is about 0.006.
Answerz = −2.5 and p is about 0.006: strong evidence the boxes are underfilled
Example: A coin
A coin lands heads 60 times in 100 tosses. Test H₀: p = 0.5 against p ≠ 0.5.
- SE = √(0.5 × 0.5 ÷ 100), which is 0.05.
- z = (0.6 − 0.5) ÷ 0.05, which is 2.
- Two-sided, so double the tail: 2 × 0.023 = 0.046.
Answerp is about 0.046, just under 0.05: some evidence the coin is biased
Errors and conclusions
If p ≤ α, reject H₀: the data are unlikely under it. If p > α, fail to reject H₀: the evidence is not strong enough, which is not proof that H₀ is true.
| Decision | H₀ true | H₀ false |
|---|---|---|
| Reject H₀ | Type I error, chance α | Correct |
| Fail to reject | Correct | Type II error |
Example: Which error?
A trial concludes that a useless medicine works. Which error is this?
- The truth is H₀: the medicine has no effect.
- The test rejected H₀ anyway.
AnswerA type I error
Example: Significance and size
A huge study finds a diet lowers weight by 0.1 kg on average, with p = 0.001. Is the effect important?
- The tiny p-value says the effect is probably real.
- But 0.1 kg is too small to matter to anyone.
AnswerStatistically significant, but not practically important
Try it yourself
Work each one on paper first, then open the answer to check.
A school claims its mean test score is 75. You suspect it is higher. State Hₐ.
Show answer
μ > 75
p = 0.03 and α = 0.05. What do you conclude?
Show answer
Reject H₀
p = 0.20 and α = 0.05. What do you conclude?
Show answer
Fail to reject H₀: there is not enough evidence
x̄ = 52, μ₀ = 50, σ = 10 and n = 100. What is z?
Show answer
2
Failing to reject a false null hypothesis is which type of error?
Show answer
Type II
If α = 0.01, what is the chance of a type I error when H₀ is true?
Show answer
0.01