p̂ and its confidence interval
◈ 6 cardsA proportion is the mean of 0/1 data, so p̂ is approximately normal with SE √(p(1 − p)/n); the interval is p̂ ± z_{α/2} √(p̂(1 − p̂)/n), valid when np̂ and n(1 − p̂) are both at least 5.
A proportion is a mean in disguise
Code each unit 1 if it has the attribute and 0 if not. The sample mean of those 0/1 values is the sample proportion , where counts the 1s. Module 8’s CLT therefore applies to exactly as it applies to : for large ,
The variance is the Bernoulli variance from Module 6 — there is no separate to estimate, because once is known the spread is known too. That is why inference for a proportion is always z, never t: the t distribution exists to absorb the uncertainty in an estimated , and a proportion has none.
The population in the SE is unknown, so the interval substitutes :
Valid when the normal approximation holds: and — at least five successes and five failures in the sample.
Worked example — Maple Ledger’s invoice error rate
An internal audit at Maple Ledger checks a random sample of 500 processed invoices and finds 60 with at least one error. Estimate the error rate for all invoices with a 95 % interval.
Conditions. and . Fine.
Estimate. .
Standard error.
Margin. .
Interval. .
With 95 % confidence, between 9.2 % and 14.9 % of all Maple Ledger invoices contain an error. Not "95 % of invoices"; not "a 95 % probability that is in the interval" — the same wording rules as Module 9, with the parameter now a proportion.
What moves the width
The margin is . Halving it needs four times the sample, as for a mean. And is largest at (where it equals 0.25) and shrinks towards either end: a proportion near 0.12 is estimated more precisely than one near 0.5 from the same , which is the fact L12.2 turns into the minimum- rule.
Reading the interval as a test
If the firm’s tolerable error rate is 10 %, the interval contains 0.10 — so a two-sided test at 5 % would not reject . L12.3 runs that test properly, and shows that the test’s SE is built differently from the interval’s; the duality is approximate for proportions, not exact, but the reading is usually the same.