| Standard deviation of pΜ | |
|---|---|
| Confidence interval | |
| Test statistic |
Lesson
The theory β Inference for One Proportion
Inference for a proportion uses the sample proportion pΜ = x/n to estimate the population proportion p with a confidence interval, or to judge a claimed value pβ with a significance test.
Where the formula comes from
- The sampling distribution of pΜ. Over repeated random samples, pΜ has mean p and standard deviation β(p(1 β p)/n), and its distribution is close to normal when np and n(1 β p) are both at least 10.
- Check the conditions. Random: a random sample, or random assignment in an experiment. 10%: when sampling without replacement, n is at most a tenth of the population. Large counts: for an interval, at least 10 successes and 10 failures; for a test, n pβ and n(1 β pβ) at least 10.
- The interval. pΜ Β± z* times the standard error, which uses pΜ because p is unknown. z* comes from the confidence level: 1.645 for 90%, 1.96 for 95%, 2.576 for 99%. Interpret it in context: we are 95% confident that the interval captures the population proportion, where 95% is how often the method succeeds over repeated samples.
- The test. State Hβ: p = pβ and the alternative. Assume Hβ is true, so the standard deviation of pΜ uses pβ. z says how many standard deviations pΜ lies from pβ, and the p-value is the chance, if Hβ is true, of a pΜ at least that far in the direction of Hβ.
- Conclude in context. If the p-value is below Ξ±, reject Hβ: there is convincing evidence for Hβ. Otherwise fail to reject Hβ: the evidence is not convincing, which is not evidence that Hβ is true. Rejecting a true Hβ is a Type I error, and the test is built to make its chance Ξ±; with a count that is only roughly normal it is only roughly Ξ±, and at n = 100 and pβ = 0.1 a 5% test rejects a true Hβ 6.4% of the time. Failing to reject a false Hβ is a Type II error.
- Assumes
- The normal model is an approximation to the binomial count. When large counts fail, the page prints the exact binomial p-value beside the normal one; its two-sided version doubles the smaller tail.
Problems solved in full
-
The sampling distribution of pΜ 2 steps
Suppose 10% of a schoolβs students walk to school. Describe the sampling distribution of pΜ for random samples of 100 students.
-
Its centre and spread follow from p and n:
-
Its shape is approximately normal, because both expected counts reach 10:
Answer
Approximately normal, with mean 0.1 and standard deviation 0.03.
-
-
The 10% condition 2 steps
The sample of 100 students is drawn without replacement from a school of only 400. Check the conditions for inference about the proportion who walk.
Show solution
-
Large counts hold, as in the first problem. The 10% condition does not:
-
Without replacement from a small population, pΜ varies less than the formula says. The finite-population factor measures by how much:
Answer
The 10% condition fails (100 > 40). The formulaβs 0.03 overstates the spread of pΜ; corrected for the small population it is about 0.026.
-
-
Constructing a confidence interval 2 steps
In a random sample of 1,000 of a cityβs 300,000 voters, 520 back a candidate. Construct and interpret a 95% confidence interval for the proportion of all the cityβs voters who back her.
Show solution
-
Conditions: a random sample; 1,000 is less than a tenth of 300,000; 520 successes and 480 failures. The sample proportion and its standard error:
-
Multiply by z* = 1.96 and add and subtract:
Answer
(0.489, 0.551). We are 95% confident that between 48.9% and 55.1% of the cityβs voters back the candidate.
-
-
Using an interval to judge a claim 2 steps
In a random sample of 100 students, 10 walk to school. A newspaper claims that 17% of the schoolβs students walk. Use a 95% confidence interval to judge the claim.
Show solution
-
The interval, from 10 successes and 90 failures:
-
Compare the claimed value with the interval:
Answer
The interval (0.041, 0.159) does not contain 0.17, so 17% is not a plausible value for the proportion who walk.
-
-
A two-sided significance test 2 steps
A school of 1,200 students claims that 10% of them walk to school; in a random sample of 100, 17 do. Test the claim at the 5% level.
Show solution
-
Hypotheses: Hβ: p = 0.1, Hβ: p β 0.1. Conditions: a random sample; 100 is less than a tenth of 1,200; n pβ = 10 and n(1 β pβ) = 90. The test statistic, with the standard deviation from pβ:
-
The two-sided p-value:
Answer
p = 0.020 < 0.05, so reject Hβ: there is convincing evidence that the proportion of students who walk is not 10%.
-
-
A one-sided test that fails to reject 2 steps
With 520 of 1,000 randomly sampled voters backing the candidate, is there convincing evidence that a majority of all the cityβs voters back her? Use Ξ± = 0.05.
Show solution
-
Hypotheses: Hβ: p = 0.5, Hβ: p > 0.5. Large counts: 500 and 500. The test statistic:
-
The one-sided p-value:
Answer
p = 0.103 β₯ 0.05, so fail to reject Hβ: there is not convincing evidence of a majority. That is not evidence against one, either.
-
-
When large counts fail, and the errors at stake 3 steps
A supplier claims 2% of its parts are defective. In a random sample of 100, 5 are. Is the z-test appropriate? Find the exact p-value for Hβ: p > 0.02, and say what a Type I and a Type II error would mean here.
Show solution
-
Large counts for the test fail:
-
Use the binomial distribution itself. If p = 0.02, the number of defects X is binomial with n = 100:
-
A Type I error would be concluding that the supplierβs defect rate is above 2% when it is not; a Type II error would be missing a defect rate that really is above 2%.
Answer
No: n pβ = 2 < 10. The exact p-value is 0.051, against 0.016 from the normal curve, so at the 5% level the evidence falls just short.
-
-
Choosing the sample size 2 steps
How large a random sample gives a 95% confidence interval with a margin of error of at most 3 percentage points, whatever the true proportion?
Show solution
-
pΜ(1 β pΜ) is largest at pΜ = 0.5, so plan with that:
-
Round up, because 1,067 would give a margin slightly over 3 points:
Answer
n = 1,068.
-
Supplementary problems, answers only
-
In a random sample of 60, 45 have a property. Find a 90% confidence interval for the population proportion.
Show answer
(0.658, 0.842)
-
Test whether Kerrichβs coin, 5,067 heads in 10,000 tosses, was fair, at Ξ± = 0.05.
Show answer
z = 1.34, p = 0.18: fail to reject; no convincing evidence the coin was biased.
-
Find a 95% confidence interval for the proportion of heads from Kerrichβs 10,000 tosses.
Show answer
(0.497, 0.516), which contains 0.5
-
How large a sample gives a 90% interval with a margin of error of at most 4 percentage points, whatever the true proportion?
Show answer
n = 423
-
A coin lands heads 40 times in 100 tosses. Test Hβ: p = 0.5 against Hβ: p < 0.5 at Ξ± = 0.05.
Show answer
z = β2, p = 0.023: reject Hβ; there is convincing evidence that the coin lands heads less than half the time.
-
In the voter poll of 520 out of 1,000, what does β95% confidentβ mean?
Show answer
If many random samples of 1,000 voters were taken and an interval built from each in the same way, about 95% of those intervals would capture the true proportion. It is not the chance that this one interval, (0.489, 0.551), contains it: that either happened or did not.
-
A test is run at Ξ± = 0.01. If Hβ is in fact true, about how likely is the test to reject it, and what is that mistake called?
Show answer
About 0.01, exactly 0.01 only if the sampling distribution were exactly normal; rejecting a true Hβ is a Type I error. Once a test has rejected, 0.01 is not the chance that this particular rejection is a mistake.
Learning path
Statistics: from data to proportions
References (2)
- Insight block 3 and the Kerrich preset: John Kerrich, interned in Denmark in 1941, tossed a coin 10,000 times and it landed heads 5,067 times; his weighted wooden disc, tossed 1,000 times, did show a bias: Gelman, A. & Nolan, D. (2002). You can load a die, but you can't bias a coin. The American Statistician, 56(4), 308β311.
- Why the large-counts condition is a rule of thumb rather than a guarantee: the coverage of the standard interval, pΜ Β± z* SE, is erratic far more persistently than is usually appreciated, and the textbook prescriptions for when it is safe cannot be trusted; the Wilson, Jeffreys and AgrestiβCoull intervals are recommended instead: Brown, L. D., Cai, T. T. & DasGupta, A. (2001). Interval estimation for a binomial proportion. Statistical Science, 16(2), 101β133.