๐Ÿ“– The Language of Hypothesis Testing

A Level Maths Year 1 ยท Hypothesis Testing

Level 3 · Ages 16–17

← Back to topic overview
1 What a Hypothesis Test Does

A hypothesis test (DfE content area O ยท Statistical hypothesis testing) uses data from a sample to make a decision about a population parameter. At AS level the parameter is the probability $p$ of "success" in a binomial model โ€” the probability that a coin lands heads, that a seed germinates, that a patient recovers.

A sample never tells you $p$ exactly. Even a fair coin will not give exactly $10$ heads in every $20$ throws. A hypothesis test asks: is the sample result so far from what we expected that "chance" is no longer a believable explanation?

The whole topic rests on a small set of precisely defined words. Each section below defines one or two of them, with an example in the same context so you can see how they fit together.

Running context. A website claims that $30\%$ of its visitors make a purchase. A marketing manager believes a redesign has increased this proportion. She takes a random sample of $20$ visitors and counts how many make a purchase.
2 The Null and Alternative Hypotheses
The null hypothesis $H_0$ is the claim that is assumed to be true unless the evidence says otherwise. It always states a single exact value of the parameter.
The alternative hypothesis $H_1$ is what you will conclude is likely if the evidence goes against $H_0$. It states a range of values.
The general form
$H_0: p = p_0 \qquad H_1: p > p_0 \;\;\text{or}\;\; p < p_0 \;\;\text{or}\;\; p \neq p_0$
Worked Example 1 โ€” Writing hypotheses

Write hypotheses for the website context, and for two further situations.

โ‘ Website: let $p$ = probability that a visitor makes a purchase. $H_0: p = 0.3$,  $H_1: p > 0.3$ (the manager suspects an increase).
โ‘กSpinner: a five-sided spinner should land on red with probability $0.2$; Ali thinks it lands on red too rarely. $H_0: p = 0.2$,  $H_1: p < 0.2$.
โ‘ขLeft-handedness: $11\%$ of people are left-handed; a researcher asks whether the proportion is different among musicians. $H_0: p = 0.11$,  $H_1: p \neq 0.11$.
Always define $p$ in words first. "$p = 0.3$" means nothing until you say what $p$ is the probability of.
Hypotheses are about the population parameter. "$H_0: X = 6$" or "$H_0$: the sample proportion is $0.3$" are wrong. The sample is what you observe; the hypothesis is about what is true for the whole population.
Decide $H_1$ before looking at the data. The direction of the test comes from the question being asked ("increased", "decreased", "changed"), never from whether the sample happened to come out high or low.
3 Test Statistic, Significance Level and Tails
TermDefinitionWebsite example
Test statisticA quantity calculated from the sample, used to decide whether to reject $H_0$.$X$ = number of the $20$ visitors who buy
Null distributionThe distribution of the test statistic when $H_0$ is true.$X \sim \mathrm{B}(20,\,0.3)$
Significance level $\alpha$The probability threshold below which a result is judged too unlikely to have happened by chance under $H_0$.$5\%$
One-tailed test$H_1$ is $p > p_0$ or $p < p_0$; only one direction counts as evidence.$H_1: p > 0.3$
Two-tailed test$H_1$ is $p \neq p_0$; extreme results in either direction count, so $\alpha$ is split equally between the two tails.โ€”
Worked Example 2 โ€” One tail or two?

State whether each test is one- or two-tailed and write $H_1$.

โ‘ "Test whether the coin is biased." Biased could mean either way: two-tailed, $H_1: p \neq 0.5$.
โ‘ก"Test whether the coin is biased towards tails", with $p$ = P(heads). One-tailed, $H_1: p < 0.5$.
โ‘ข"Test whether the new fertiliser improves the germination rate of $85\%$." One-tailed, $H_1: p > 0.85$.
โ‘ฃ"Test whether the proportion of defective items is different from $5\%$." Two-tailed, $H_1: p \neq 0.05$.
Why choose $5\%$? It is a convention, not a law. A smaller significance level (say $1\%$) demands stronger evidence before rejecting $H_0$. That is sensible when a wrong rejection would be costly โ€” for example, switching a whole hospital to a new drug.
4 Critical Region, Critical Value and Acceptance Region
The critical region (or rejection region) is the set of values of the test statistic that would lead you to reject $H_0$. The critical value is the first value inside the critical region โ€” the boundary. The acceptance region is everything else: values that do not lead to rejecting $H_0$.

For a one-tailed test at level $\alpha$, the critical region is chosen to be as large as possible while its total probability under $H_0$ is still no more than $\alpha$.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0.05 0.10 0.15 x P(X = x) critical region acceptance region X ~ B(20, 0.3): the critical region X ≥ 10 (red) has total probability 0.0480
Worked Example 3 โ€” Finding the critical region

For the website test ($H_0: p = 0.3$, $H_1: p > 0.3$, $n = 20$, $5\%$ level), find the critical region.

โ‘ Under $H_0$, $X \sim \mathrm{B}(20,\,0.3)$. The mean is $np = 6$; evidence for $H_1$ means large values of $X$.
โ‘กTry $X \geqslant 9$:  $\mathrm{P}(X \geqslant 9) = 1 - \mathrm{P}(X \leqslant 8) = 1 - 0.8867 = 0.1133$. Too big.
โ‘ขTry $X \geqslant 10$:  $\mathrm{P}(X \geqslant 10) = 1 - \mathrm{P}(X \leqslant 9) = 1 - 0.9520 = 0.0480$. Less than $0.05$ โœ“
โ‘ฃCritical region: $X \geqslant 10$.  Critical value: $10$.  Acceptance region: $X \leqslant 9$.
Show both probabilities โ€” the one just inside ($0.0480$) and the one just outside ($0.1133$). That is how the examiner sees that your boundary is correct.
"Critical value" for discrete data. The critical value is a value of $X$ โ€” here $10$ โ€” not a probability. Do not write "the critical value is $0.0480$".
5 p-values and the Actual Significance Level
The p-value is the probability, assuming $H_0$ is true, of getting a result at least as extreme as the one observed (in the direction of $H_1$). If the p-value is less than or equal to the significance level, the result is significant and $H_0$ is rejected.
Upper-tail and lower-tail p-values
$H_1: p > p_0$:   p-value $= \mathrm{P}(X \geqslant x_{\text{obs}})$     $H_1: p < p_0$:   p-value $= \mathrm{P}(X \leqslant x_{\text{obs}})$
Worked Example 4 โ€” Using a p-value

In the website sample, $10$ of the $20$ visitors make a purchase. Find the p-value and make a decision.

โ‘ p-value $= \mathrm{P}(X \geqslant 10) = 0.0480$.
โ‘ก$0.0480 < 0.05$: the result is significant at the $5\%$ level, so reject $H_0$.
โ‘ขConsistent with Worked Example 3: $10$ is in the critical region.
Because the binomial distribution is discrete, the critical region rarely has probability exactly $\alpha$. Its true probability under $H_0$ is the actual significance level. It is also the probability of rejecting $H_0$ when $H_0$ is in fact true.
Worked Example 5 โ€” Actual significance level

State the actual significance level of the website test, and interpret it.

โ‘ Actual significance level $= \mathrm{P}(X \geqslant 10 \mid p = 0.3) = 0.0480 = 4.80\%$.
โ‘กInterpretation: if the redesign has made no difference, there is a $4.80\%$ chance that the manager will wrongly conclude that it has increased sales.
For a two-tailed test the actual significance level is the sum of the probabilities of both tails of the critical region.
6 Writing a Conclusion

A full conclusion has two parts: a statistical decision, and what it means in context. The language must be non-assertive, because a test never proves anything.

DecisionGood conclusion
Reject $H_0$"There is sufficient evidence at the $5\%$ level to suggest that the proportion of visitors making a purchase has increased."
Do not reject $H_0$"There is insufficient evidence at the $5\%$ level to suggest that the proportion of visitors making a purchase has increased."
Worked Example 6 โ€” Improving a weak conclusion

Explain what is wrong with each conclusion.

โ‘ "Reject $H_0$." โ€” No context. It says nothing about visitors or purchases.
โ‘ก"This proves the redesign increased sales." โ€” Too assertive. A fair test can give a significant result by chance ($4.80\%$ of the time here).
โ‘ข"Accept $H_0$: the proportion is $0.3$." โ€” Not rejecting $H_0$ does not show it is true. There is simply not enough evidence against it.
โ‘ฃ"The sample proportion is greater than $0.3$." โ€” True ($10/20 = 0.5$) but irrelevant; the question is about the population.
Do not contradict yourself. If you reject $H_0$, the context sentence must say there is evidence for $H_1$. A mismatch between the decision and the sentence loses the final mark.
7 Quick Reference

$H_0$

Assumed true; one exact value, $p = p_0$.

$H_1$

$p > p_0$, $p < p_0$ (one-tailed) or $p \neq p_0$ (two-tailed).

Test statistic

The count $X$; under $H_0$, $X \sim \mathrm{B}(n,\,p_0)$.

Significance level

Threshold probability for rejecting $H_0$.

Critical region

Values of $X$ that lead to rejecting $H_0$; probability $\leqslant \alpha$.

Critical value

The boundary value of $X$ inside the critical region.

Acceptance region

Values of $X$ that do not lead to rejecting $H_0$.

p-value

P(observed or more extreme $\mid H_0$).

Actual significance level

P(critical region $\mid H_0$) = P(wrongly rejecting $H_0$).

8 Practice Questions

Give probabilities to 4 decimal places. Use the binomial functions on your calculator.

Question 1

Explain the difference between the null hypothesis and the alternative hypothesis.

โ–ถ Show solution

The null hypothesis $H_0$ is the claim assumed to be true; it gives a single exact value of the parameter, such as $p = 0.3$.

The alternative hypothesis $H_1$ is what is suspected instead and is accepted as likely if there is enough evidence against $H_0$; it gives a range of values, such as $p > 0.3$.

Question 2

A games company says that a sticker appears in $1$ in $6$ packets of cards. A collector thinks stickers are more common than this. Define a parameter and write down suitable hypotheses.

โ–ถ Show solution

Let $p$ be the probability that a packet contains a sticker.

$H_0: p = \tfrac16$,  $H_1: p > \tfrac16$

Question 3

In a town, $35\%$ of adults cycle to work. A councillor wants to test whether the proportion is different in a neighbouring town. Write down hypotheses and state whether the test is one- or two-tailed.

โ–ถ Show solution

Let $p$ be the probability that an adult in the neighbouring town cycles to work.

$H_0: p = 0.35$,  $H_1: p \neq 0.35$. "Different" allows either direction, so the test is two-tailed.

Question 4

A two-tailed test of $H_0: p = 0.3$ with $n = 20$ has critical region $X \leqslant 1$ or $X \geqslant 11$. (a) Write down the critical values. (b) Write down the acceptance region.

โ–ถ Show solution

(a) The critical values are $1$ and $11$.

(b) Acceptance region: $2 \leqslant X \leqslant 10$.

Question 5

For the test in Question 4, find the actual significance level.

โ–ถ Show solution

Under $H_0$, $X \sim \mathrm{B}(20,\,0.3)$.

$\mathrm{P}(X \leqslant 1) = 0.0076$

$\mathrm{P}(X \geqslant 11) = 1 - \mathrm{P}(X \leqslant 10) = 1 - 0.9829 = 0.0171$

Actual significance level $= 0.00764 + 0.01714 = 0.0248$ (to 4 d.p.), i.e. $2.48\%$. Add the unrounded values โ€” adding the 4 d.p. figures gives $0.0247$.

Question 6

$H_0: p = 0.5$, $H_1: p > 0.5$, and the observed value of $X \sim \mathrm{B}(12,\,0.5)$ is $10$. Find the p-value and state whether the result is significant at the $5\%$ level.

โ–ถ Show solution

p-value $= \mathrm{P}(X \geqslant 10) = 1 - \mathrm{P}(X \leqslant 9) = 1 - 0.9807 = 0.0193$.

$0.0193 < 0.05$, so the result is significant: reject $H_0$.

Question 7

A student writes: "The p-value is $0.0193$, so there is a $1.93\%$ chance that $H_0$ is true." Explain the error.

โ–ถ Show solution

The p-value is calculated assuming $H_0$ is true. It is the probability of getting a result at least as extreme as the one observed if $H_0$ is true.

It is not the probability that $H_0$ is true โ€” $H_0$ is either true or false, and the test does not give a probability for that.

Question 8

Rewrite this conclusion so that it would earn full marks: "Reject $H_0$. The dice is definitely biased." (The test was of $H_1: p > \tfrac16$, where $p$ is the probability of a six, at the $5\%$ level.)

โ–ถ Show solution

"Reject $H_0$. There is sufficient evidence at the $5\%$ level to suggest that the die shows a six more often than one time in six."

The word "definitely" is too assertive, and "biased" does not match the one-tailed alternative hypothesis.

Question 9

A test of $H_0: p = 0.2$ against $H_1: p > 0.2$ uses a sample of $25$, at the $5\%$ level. The critical region is $X \geqslant 9$. (a) Find the actual significance level. (b) The observed value is $8$. Write a conclusion.

โ–ถ Show solution

(a) Under $H_0$, $X \sim \mathrm{B}(25,\,0.2)$. $\mathrm{P}(X \geqslant 9) = 1 - \mathrm{P}(X \leqslant 8) = 1 - 0.9532 = 0.0468$, i.e. $4.68\%$.

(b) $8$ is not in the critical region, so do not reject $H_0$. There is insufficient evidence at the $5\%$ level to suggest that $p$ is greater than $0.2$.

Question 10

A cafรฉ owner believes that $25\%$ of customers order a hot chocolate. A new barista thinks the proportion is higher. A random sample of $20$ customers is taken.

(a) Define a parameter and write down hypotheses.   (b) Find the critical region at the $5\%$ level.   (c) State the actual significance level and explain what it means here.   (d) $8$ customers in the sample order hot chocolate. What should the barista conclude?

โ–ถ Show solution

(a) Let $p$ be the probability that a customer orders a hot chocolate. $H_0: p = 0.25$,  $H_1: p > 0.25$.

(b) Under $H_0$, $X \sim \mathrm{B}(20,\,0.25)$.

$\mathrm{P}(X \geqslant 8) = 1 - \mathrm{P}(X \leqslant 7) = 0.1018$ โ€” too big.

$\mathrm{P}(X \geqslant 9) = 1 - \mathrm{P}(X \leqslant 8) = 0.0409$ โ€” less than $0.05$ โœ“

Critical region: $X \geqslant 9$.

(c) Actual significance level $= 0.0409 = 4.09\%$. If the true proportion really is $25\%$, there is a $4.09\%$ chance that the test will wrongly suggest that it is higher.

(d) $8$ is not in the critical region, so do not reject $H_0$. There is insufficient evidence at the $5\%$ level to suggest that more than $25\%$ of customers order a hot chocolate.

The Language of Hypothesis Testing · A Level Maths Year 1 · Created with MathJax