14.2 Binomial tests for a proportion — Learn
Prerequisites: the language of hypothesis testing from Section 14.1, and the binomial distribution and its probabilities from earlier in this book.
By the end of this section you can: carry out a full binomial hypothesis test for a proportion; handle lower-tail, upper-tail and two-tailed tests; and write the decision as a conclusion about the population, not about the sample.
1. The five steps of a test
Every binomial test follows the same five steps. Write them down each time until the order becomes automatic.
- Write the null hypothesis , the alternative hypothesis , and the significance level .
- State the model for the test statistic under . For a proportion the model is $$ X \sim \mathrm{B}(n,\ p_0), $$ where is the sample size and is the value in .
- Find the observed value of from the sample.
- Find the p-value, or compare with the critical region.
- Compare with , decide the test, and write the conclusion in the context of the original claim.
Step 5 is the step that wins marks. The decision is "reject " or "retain ". The conclusion is a sentence about the claim, and it says which significance level was used.
2. A lower-tail test
The customer's voucher problem from Section 14.1 runs through all five steps.
Step 1. The claim is , and the customer suspects fewer vouchers:
Step 2. Under , the number of vouchers in 20 packets is
Step 3. The sample gives .
Step 4. The alternative uses , so the tail is the lower tail. The results "at least as extreme" as 1 are and :
Step 5. Compare the p-value with the level:
Reject . There is sufficient evidence at the 5% level that fewer than 1 packet in 4 contains a voucher.
3. An upper-tail test
A company claims that 30% of students walk to school. A sample of 25 students contains 12 who walk. A parent group suspects the true proportion is higher.
Step 1.
Step 2. Under ,
Step 3. The sample gives .
Step 4. The alternative uses , so the upper tail is needed:
Step 5. Since , reject . There is sufficient evidence at the 5% level that more than 30% of students walk to school.
4. A two-tailed test
A coin is tossed 20 times and shows 15 heads. Test at the 5% level whether the coin is fair.
Step 1. A fair coin means , and bias in either direction matters:
Step 2. Under ,
Step 3. The sample gives .
Step 4. The value 15 is above the centre. Find the smaller tail, then double it:
Step 5. Since , reject . There is sufficient evidence at the 5% level that the coin is not fair.
If uses , the p-value is twice the smaller one-sided tail. If uses or , do not double it.
5. The significance level as a risk
In Section 14.1 the level was defined as the probability of rejecting when is true. The binomial test shows the definition at work.
For the voucher test at the 5% level, the critical region is . If is true, the probability of landing in that region is
So the test wrongly rejects a true claim in about 2.4% of samples, even though the level chosen was 5%. The probability can be smaller than , because a discrete count cannot always be cut at exactly 5%.
A smaller makes the test safer against a false alarm, but it also makes the test harder to pass. At the 1% level the same voucher data give a p-value of , and
so the test retains . The evidence that was enough at 5% is not enough at 1%. Report the level with every conclusion.
6. More worked examples
Example 1 — a retained claim. A manufacturer claims that 1 in 5 components is faulty. A sample of 30 components contains 2 faulty ones. Test at the 5% level whether the fault rate is lower than the claim.
The claim is and the concern is lower, so
Under , , and the sample gives . The p-value is
Since , the test rejects at the 5% level. At the 1% level, , so the test retains . The level changes the decision.
Example 2 — from the critical region. For , find the critical region at the 5% level, then use it to test the sample that found 2 vouchers.
Work up the lower tail from :
The largest tail whose probability is at most is , so the critical region is and the acceptance region is . The value lies in the acceptance region, so the test retains . This agrees with the p-value route, where .
Example 3 — an upper-tail test that retains. A call centre claims that 70% of calls are answered within 30 seconds. In a sample of 40 calls, 32 are answered in time. Test at the 5% level whether the proportion is higher than the claim.
Under , , and the sample gives . The upper tail is
Since , the test retains . There is not sufficient evidence that more than 70% of calls are answered in 30 seconds.
7. What the test assumes
The binomial model needs two assumptions.
- Each observation has the same probability under .
- The observations are independent.
The second assumption is the one that fails most often. A sample of 20 packets from one shop on one day may share a batch, so one unusual batch affects every packet in the sample. When the assumptions are doubtful, say so, and treat the conclusion with more caution.
Watch out. Five traps are common in this section.
Doubling a one-tailed p-value. Only a test with doubles the tail. A test with or uses one tail.
Doubling the wrong tail. A two-tailed result doubles the smaller tail, the one containing the observed value. Doubling the larger tail gives a p-value above 1 or above the answer.
Using the sample proportion inside the model. The model under uses , the value in the claim. The sample proportion is the evidence, not the model. For the vouchers the model is , never .
Saying "accept ". The test has not proved the claim. Write "retain " or "there is not sufficient evidence".
Forgetting the level. "Reject " on its own is incomplete. Add "at the 5% level" or "at the 1% level" so the reader knows the risk you accepted.
Re-check: after the decision, read the conclusion back to the original claim. It must be about the population, and it must name the level.
Progress check
- Return to the company's claim that 1 packet in 4 contains a voucher. Carry out the full test at the 5% level for the sample of 20 packets with 1 voucher. State the model, the p-value, the decision and the conclusion.
- A second sample of 20 packets contains 4 vouchers. Find the p-value and decide at the 5% level, using the lower tail.
- Explain why the test in question 2 is one-tailed, and how the work would change if .
You should now be able to
- write , and for a claim about a proportion;
- choose the correct model under ;
- find a lower-tail or upper-tail p-value from a binomial distribution;
- double the smaller tail for a two-tailed test;
- use a critical region as an alternative to a p-value;
- interpret the significance level as the risk of wrongly rejecting ;
- write a conclusion in context that names the significance level.