M5.7.6 Chapter 6
Testing a claim
A seed packet says that 80% of its seeds grow. Amina plants 20 and only 12 grow. Should she doubt the claim?
Your guess
Pick one before you read on. It is fine to be wrong.
By the end you can
- Set up a null and an alternative hypothesis
- Test a claim about a binomial probability at the 5% level
- Write a conclusion in words that does not say more than the test shows
A hypothesis test weighs a claim against a sample. We cannot ask every seed, so we plant 20, and ask whether the result would be a surprise if the claim were true. A surprising result is evidence against the claim. A result that is not surprising is not evidence against it.
The claim we test is the null hypothesis, H₀. It gives p a value: H₀: p = 0.8. We act as if it is true, and look for evidence that it is not. The alternative hypothesis, H₁, says what we suspect instead. Amina suspects fewer seeds grow, so H₁: p < 0.8. This is a one tailed test, because it looks in one direction only. If the suspicion is "different, in either direction", H₁: p ≠ 0.8, the test is two tailed. Decide H₁ from the question, before you look at the data.
If H₀ is true, the number of seeds that grow is X ~ B(20, 0.8). This is the test statistic. The picture shows its distribution. Most of the weight is near 16. A result of 12 or fewer lies far out on the left.
Draw it first
Draw the distribution if the claim is true, and shade the tail
1 Draw the bars of B(20, 0.8), as if the claim were true. The tallest bar is at 16.
2 Shade the bars from 0 up to the result, 12. The shaded area is P(X ≤ 12), the chance of a result as low as Amina's or lower.
The significance level is the line for "too unlikely". It is usually 5%. If the chance of a result as extreme as ours, when H₀ is true, is 5% or less, we reject H₀. We say the result is significant at the 5% level. This way, if H₀ is true, we wrongly reject it in at most 5% of tests.
The steps. (1) Write H₀ and H₁ with p. (2) Say what X is and its distribution if H₀ is true. (3) Find the probability of a result as extreme as the one seen, in the direction of H₁. (4) Compare it with the level. (5) Reject or do not reject H₀, and say what it means in the words of the question.
Worked example
A seed packet claims that the probability that a seed grows is 0.8. Amina suspects it is lower. Write the hypotheses.
- The claim is p = 0.8, so H₀: p = 0.8.
- Amina suspects a lower probability, in one direction only, so H₁: p < 0.8.
- This is a one tailed test.
Answer: H₀: p = 0.8 and H₁: p < 0.8
Worked example
Amina plants 20 seeds and 12 grow. Test the packet's claim at the 5% level.
- H₀: p = 0.8 and H₁: p < 0.8.
- If H₀ is true, X, the number of seeds that grow, is B(20, 0.8).
- The result is 12, so we need P(X ≤ 12). Adding the bars gives P(X ≤ 12) = 0.0321.
- Compare: 0.0321 is less than 0.05, so the result is in the critical region.
- Reject H₀. There is evidence at the 5% level that fewer than 80% of the seeds grow.
Answer: Reject H₀, because P(X ≤ 12) = 0.0321 is less than 0.05.
Another way to decide is to find the critical region first. It is the set of values of X for which H₀ is rejected. For H₁: p < 0.8 the region is a lower tail, X ≤ c. Take c as large as possible with P(X ≤ c) at most 5%. If the result falls in the region, reject H₀.
Worked example
X ~ B(20, 0.8) if H₀ is true. Find the critical region for a one tailed test of H₁: p < 0.8 at the 5% level. Give the actual significance level.
- Work up from the bottom: P(X ≤ 11) = 0.0100, P(X ≤ 12) = 0.0321 and P(X ≤ 13) = 0.0867.
- 0.0321 is at most 0.05, but 0.0867 is more. So c = 12.
- The critical region is X ≤ 12.
- The actual significance level is the chance of landing in the region when H₀ is true: 0.0321, about 3.2%.
Answer: The critical region is X ≤ 12 and the actual significance level is 0.0321.
The actual significance level is below 5% because X takes whole numbers only, and the tail cannot be cut at exactly 5%. It never goes above 5%.
In a two tailed test the 5% is shared. Put at most 2.5% in each tail. Take the tail in the direction of the result, and compare its probability with 0.025, not 0.05.
Worked example
A gardener says that half of the seeds from her plants give white flowers. Kofi plants 20 and gets 15 white flowers. Test at the 5% level whether the proportion is different from a half.
- H₀: p = 0.5 and H₁: p ≠ 0.5. This is a two tailed test, so each tail may have at most 0.025.
- If H₀ is true, X, the number of white flowers, is B(20, 0.5).
- The result 15 is in the upper tail, so we need P(X ≥ 15) = 1 − P(X ≤ 14) = 0.0207.
- Compare with the tail level: 0.0207 is less than 0.025.
- Reject H₀. There is evidence at the 5% level that the proportion of seeds giving white flowers is not one half.
Answer: Reject H₀, because P(X ≥ 15) = 0.0207 is less than 0.025.
Be careful with the words of the conclusion. When a result is not in the critical region, we say "do not reject H₀" and "there is not enough evidence at the 5% level to say that...". We never say that H₀ is proved. A sample that fails to show a difference does not show there is none.
See it three ways
With things
A packet of seeds has a claim printed on it. Until we have strong evidence against the claim, we go on trusting it. Only a result that is very unlikely if the claim is right makes us doubt it.
As a picture
In words
Find the chance, if the claim is true, of a result as extreme as the one seen. If it is 5% or less, reject the claim.
In symbols
H₀: p = 0.8, H₁: p < 0.8. X ~ B(20, 0.8). P(X ≤ 12) = 0.0321 < 0.05, so reject H₀.
Try it
Find out what a rare result looks like
You need: a die, paper and a pencil.
- Throw a die 12 times and count the sixes. This is one run.
- Make 10 runs. Write the count of sixes for each.
- For a fair die, the number of sixes in a run is B(12, 1/6). Count how many runs gave 5 sixes or more.
What you will see: Most runs give 1, 2 or 3 sixes. For a fair die the chance of 5 or more in a run is 0.0364, about 1 run in 27. You will probably see none in 10 runs. If a die gave 5 sixes in 12 throws, we would have reason to test it.
A wrong idea many people have
If the test does not reject H₀, then H₀ is proved true.
Why it feels right: We started by assuming H₀, and the data gave no reason to drop it, so it seems to be confirmed.
The test that breaks it: Suppose the seeds really grow with probability 0.7, and Amina plants 20. The expected number is 14. A result of 14 has P(X ≤ 14) = 0.1958 under the claim p = 0.8, so we would not reject H₀: p = 0.8, yet the packet is wrong.
What is true: A test can only reject H₀ or fail to reject it. "Do not reject" means the sample gave too little evidence against H₀. With a larger sample we might find a difference.
A wrong idea many people have
The probability 0.0321 is the probability that H₀ is true.
Why it feels right: It is a small chance attached to the claim, and it seems to say how likely the claim is.
The test that breaks it: The claim p = 0.8 is either true or false, so it has no probability of its own here. The number 0.0321 was found by assuming H₀ is true, and it is the chance of X ≤ 12 under that assumption.
What is true: The tail probability is the chance of a result as extreme as ours if H₀ is true. It is not the chance that H₀ is true.
Key words
- null hypothesis
- H₀, the claim being tested. It gives p a value, such as p = 0.8, and we act as if it is true.
- alternative hypothesis
- H₁, what we suspect instead: p lower, p higher, or p different.
- significance level
- the chance below which a result is called too unlikely if H₀ is true. Usually 5%.
- critical region
- the set of results for which H₀ is rejected.
- test statistic
- the quantity we measure, here the number of successes X.
Back to your guess
The answer is C: We can decide by asking how likely 12 or fewer would be if the claim were true.
Chance makes results differ from 16 even when the claim is true, so one number being below 16 settles nothing. What counts is how unlikely a result as low as 12 would be if the packet were right. Here that chance is 0.0321, about 3 in 100. That is small enough to doubt the claim.
Check yourself
Try each one before you look. A wrong answer tells you where to go next.
A spinner is claimed to land on red with probability 0.3. Joseph suspects it lands on red more often. Which hypotheses fit?
See the answer
H₀: p = 0.3 and H₁: p > 0.3
H₀ is the claim, p = 0.3. Joseph suspects a higher probability, so H₁: p > 0.3, a one tailed test.
- If you chose B: The null hypothesis is the claim, and it gives p a value. The suspicion is the alternative hypothesis. Read this page again.
- If you chose C: That is a two tailed test. Joseph suspects red comes up more often, in one direction, so H₁ is p > 0.3. Read this page again.
A test at the 5% level gives a tail probability of 0.08 in the direction of H₁. What is the conclusion?
See the answer
Do not reject H₀, because there is not enough evidence at the 5% level.
The tail probability 0.08 is above the level 0.05, so the result is not in the critical region. We do not reject H₀, and we do not claim it is proved.
- If you chose A: A result is called significant only when its tail probability is 0.05 or less. Here 0.08 is more than 0.05. Read this page again.
- If you chose C: Failing to reject H₀ does not prove it. The sample may be too small to show a difference. Read this page again.
What does a significance level of 5% mean?
See the answer
If H₀ is true, a wrong rejection has chance at most 5%.
The test rejects H₀ for results that have at most 5% chance if H₀ is true. So when H₀ is true, a wrong rejection happens in at most 5% of tests.
- If you chose A: H₀ is either true or false. The level is a chance about test results, not about H₀. Read this page again.
- If you chose C: The level has nothing to do with the sample size. It is the chance of rejecting H₀ by bad luck when H₀ is true. Read this page again.
H₁ says p is smaller than the claimed value. Where is the critical region for the number of successes X?
See the answer
In the lower tail, small values of X.
If p is smaller than claimed, we expect few successes. So few successes, the lower tail, is the evidence against H₀.
- If you chose A: Large values of X would suggest a higher probability. H₁ says p is lower, so small values of X are the evidence. Read this page again.
- If you chose B: Both tails belong to a two tailed test. When H₁ is p smaller, only the lower tail counts. Read this page again.
A two tailed test is done at the 5% level. Each tail may have a probability of at most what?
See the answer
2.5%
The two tails together must be at most 5%, so each is at most half of that, 2.5%.
- If you chose B: Then the two tails together would be 10%. The 5% is shared between the tails. Read this page again.
- If you chose C: That is more than the level. The two tails must together be at most 5%. Read this page again.
X ~ B(15, 0.5) if H₀ is true. A two tailed test at the 5% level has H₁: p ≠ 0.5. The result is 11, and P(X ≥ 11) = 0.0592. What is the conclusion?
See the answer
Do not reject H₀, because 0.0592 is above 0.025.
The test is two tailed, so the upper tail must have probability at most 0.025. It is 0.0592, which is more. The result is not significant.
- If you chose A: The comparison is not with 0.1. A two tailed test at 5% compares each tail with 0.025. Read this page again.
- If you chose C: Being above the expected value is not enough. The tail probability must be small enough. Read this page again.
From an earlier chapter
A population has standard deviation 10. A sample of 25 values is taken. What is the standard deviation of the sample mean?
X ~ B(12, 0.3). Find P(X ≥ 7), to 4 decimal places.
See the answer
0.0386
P(X ≥ 7) = 1 − P(X ≤ 6) = 1 − 0.9614 = 0.0386.
X ~ B(15, 0.4) if H₀ is true. For a one tailed test of H₁: p < 0.4 at the 5% level, find the critical region X ≤ c. What is c?
See the answer
2
P(X ≤ 1) = 0.0052 and P(X ≤ 2) = 0.0271 are at most 0.05, but P(X ≤ 3) = 0.0905 is not. So c = 2.
The critical region for a test with X ~ B(15, 0.4) is X ≤ 2. What is the actual significance level, to 4 decimal places?
See the answer
0.0271
The actual level is the chance of the critical region if H₀ is true: P(X ≤ 2) = P(X = 0) + P(X = 1) + P(X = 2) = 0.0005 + 0.0047 + 0.0219 = 0.0271.
Keep it
Copy this into your exercise book.
H₀ is the claim. H₁ is the suspicion. If H₀ is true, X ~ B(n, p). Find the tail probability. At most 5% (2.5% each tail): reject H₀. Say it in words. Never "proved".
Draw: A bar chart of a binomial distribution with the left tail hatched and the result marked.