Hypothesis tests
🎯What you need to be able to do
- Formulate null and alternative hypotheses, and decide between one and two tails.
- Carry out a test on a population mean using the normal distribution.
- Carry out a test on a binomial proportion using exact binomial probabilities.
- Carry out a test on a Poisson mean.
- Find a critical region and the probability of a Type I error.
- Define and calculate the probability of a Type II error.
- State a conclusion in context, without overclaiming.
📚The mathematics
The structure of a test
Every test has the same five steps, and writing them out is how the marks are earned:
- State \( \mathrm{H}_0 \) and \( \mathrm{H}_1 \) in terms of a parameter (\( \mu \), \(p\) or \( \lambda \)) — never in words alone.
- State the distribution of the test statistic assuming \( \mathrm{H}_0 \) is true.
- Calculate the test statistic, or the probability of the observed result or something more extreme.
- Compare with the significance level, or with the critical value.
- State the conclusion in context.
The null hypothesis is always an equality, \( \mathrm{H}_0: \mu = 500 \). The alternative carries the direction being investigated:
- One-tailed: \( \mathrm{H}_1: \mu > 500 \) or \( \mathrm{H}_1: \mu < 500 \) — the question suspects a specific direction (“has the mean fallen?”).
- Two-tailed: \( \mathrm{H}_1: \mu \neq 500 \) — the question asks only whether the mean has changed, with no direction implied.
Testing a population mean
When the population is normal with known \( \sigma \), or the sample is large enough for the Central Limit Theorem (S2 4):
Compare \(z\) with the critical value, or compare the corresponding tail probability with the significance level. The two routes are equivalent; the \(p\)-value route is often clearer to mark and harder to get backwards.
Critical values worth knowing: one-tailed 5% is \( 1.645 \), one-tailed 1% is \( 2.326 \), two-tailed 5% is \( 1.96 \), two-tailed 1% is \( 2.576 \).
Testing a binomial proportion
For small \(n\), use the exact binomial distribution rather than an approximation. Under \( \mathrm{H}_0: p = p_0 \), calculate the probability of the observed value or more extreme, and compare it with the significance level.
“More extreme” means in the direction of \( \mathrm{H}_1 \): for \( \mathrm{H}_1: p > p_0 \) with 10 observed, that is \( \mathrm{P}(X \ge 10) \) — including the observed value itself. Excluding it is a frequent and consequential slip.
Testing a Poisson mean
Identical in structure, using \( \mathrm{Po}(\lambda_0) \) under \( \mathrm{H}_0 \), with \( \lambda \) scaled to the interval given (S2 1). For large \( \lambda \) the normal approximation may be used, with a continuity correction.
Critical regions and Type I errors
The critical region is the set of values of the test statistic that would lead to rejecting \( \mathrm{H}_0 \). For a discrete distribution it is found by trying successive values until the tail probability first drops below the significance level.
The probability of a Type I error — rejecting \( \mathrm{H}_0 \) when it is in fact true — is the probability of landing in the critical region given \( \mathrm{H}_0 \). For a continuous distribution that equals the significance level exactly. For a discrete one it is usually less, because the region cannot be tuned to hit 5% precisely.
A Type II error is failing to reject \( \mathrm{H}_0 \) when it is false. Its probability can only be calculated when a specific alternative value of the parameter is supplied, because “false” on its own does not say by how much.
✏️Worked example
(a) \( \mathrm{H}_0: \mu = 500 \), \( \mathrm{H}_1: \mu < 500 \) — one-tailed, because the question asks specifically whether the mean has fallen.
With \( n = 40 > 30 \), the Central Limit Theorem gives \( \bar{X} \sim \mathrm{N}\!\left(500, \dfrac{64}{40}\right) \) under \( \mathrm{H}_0 \). The standard error is \( \dfrac{8}{\sqrt{40}} = 1.2649 \), so
The critical value for a one-tailed 5% test is \( -1.645 \). Since \( -2.214 < -1.645 \), the result lies in the critical region. Equivalently, the \(p\)-value is \( \Phi(-2.214) = 0.0134 < 0.05 \).
Conclusion: there is evidence at the 5% level that the mean weight of the packets has fallen below 500 g.
(b) \( \mathrm{H}_0: p = 0.3 \), \( \mathrm{H}_1: p > 0.3 \). Under \( \mathrm{H}_0 \), \( X \sim \mathrm{B}(20, 0.3) \). With \(n\) small, use the exact distribution:
Since \( 0.0480 < 0.05 \), reject \( \mathrm{H}_0 \).
Conclusion: there is evidence at the 5% level that the success rate of the treatment is higher than 30%.
(c) Test successive values against 5%:
So the critical region is \( X \ge 10 \), and the probability of a Type I error is \( 0.0480 \).
📝Practise
Work through these, then reveal the answer.
1. A population has known standard deviation 10 and claimed mean 50. A sample of 100 gives a mean of 52. Test at the 5% level whether the mean has changed.
2. Explain the difference between a Type I and a Type II error, and give the probability of a Type I error for a continuous test at the 1% level.
3. A coin is claimed to be biased towards heads with \( p = 0.4 \) for tails. In 10 tosses only 1 tail appears. Test at the 5% level whether \( p < 0.4 \).
4. For the test in question 3, find the critical region and the probability of a Type I error.
5. Faults occur at a mean rate of 5 per week. In one week 10 faults occur. Test at the 5% level whether the rate has increased.
6. A test does not reject \( \mathrm{H}_0 \). A student writes: "This proves the mean is 500." Explain what is wrong, and state the correct conclusion.
🔗Go deeper — other people’s work
These are external resources, not mine. If one stops working, tell me and everything above it on this page still stands.
- Seeing Theory (Brown University) — frequentist inference and the meaning of a \(p\)-value
- Khan Academy — significance tests, Type I and Type II errors
- Cambridge examiner reports — conclusions stated without context lose marks every session