Resources For Teachers For Tutors For Students & Parents Pricing
Year 12 Maths - Methods (Unit 3 & Unit 4) Sampling and estimation

Confidence intervals for the population proportion

20 practice questions 0 video lessons Theory + worked examples
Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

A confidence interval for a population proportion \(p\) is the interval estimate \(\hat p \pm z\sqrt{\hat p(1-\hat p)/n}\), where \(\hat p=x/n\) is the sample proportion and \(z\) is the standard-normal quantile for the confidence level. The margin of error is \(E=z\sqrt{\hat p(1-\hat p)/n}\) and the interval width is \(2E\).

A point estimate of the population proportion \(p\) is the sample proportion \(\hat p=\dfrac{x}{n}\), where \(x\) of the \(n\) sampled units have the feature. Because a different sample would give a slightly different \(\hat p\), a single number is not enough: we report an interval estimate that is likely to contain \(p\).

The approximate confidence interval is \(\left(\hat p - z\sqrt{\tfrac{\hat p(1-\hat p)}{n}},\ \hat p + z\sqrt{\tfrac{\hat p(1-\hat p)}{n}}\right)\). The quantity \(\sqrt{\hat p(1-\hat p)/n}\) is the standard error of \(\hat p\), and \(z\) is the standard-normal quantile for the chosen confidence level: \(1.96\) for \(95\%\), \(1.645\) for \(90\%\) and \(2.576\) for \(99\%\).

The margin of error \(E=z\sqrt{\hat p(1-\hat p)/n}\) is how far the interval reaches either side of \(\hat p\); the interval is \(\hat p\pm E\) and its width is \(2E\). A larger sample makes the interval narrower; a higher confidence level makes it wider.

Key idea. Estimate \(\hat p=x/n\), choose \(z\) for the confidence level, compute the margin of error \(E=z\sqrt{\hat p(1-\hat p)/n}\), and report \(\hat p\pm E\). The width is \(2E\).
A confidence interval on a number lineA number line with a dot at the point estimate p-hat and whiskers reaching a margin of error E to each side; the width of the interval is 2E. p̂−E p̂+E width = 2E
The interval is \(\hat p\pm E\); its width is \(2E\)
The central confidence region of the sampling distributionA bell-shaped sampling distribution of p-hat with the central region between p-hat minus E and p-hat plus E shaded, representing the confidence level. 95% p̂−E p̂+E
The confidence level is the central shaded area of the sampling distribution

The point estimate (sample proportion):

\[\hat p=\dfrac{x}{n}\]
p^=xn

The approximate confidence interval for \(p\):

\[\left(\hat p - z\sqrt{\dfrac{\hat p(1-\hat p)}{n}},\ \ \hat p + z\sqrt{\dfrac{\hat p(1-\hat p)}{n}}\right)\]
p^±zp^(1p^)n

The margin of error and the interval width:

\[E=z\sqrt{\dfrac{\hat p(1-\hat p)}{n}} \qquad \text{width}=2E\]

The sample size for a target margin of error (round up):

\[n \ge \dfrac{z^{2}\,\hat p(1-\hat p)}{E^{2}}\]
Quantiles. \(z=1.96\) for \(95\%\), \(z=1.645\) for \(90\%\), \(z=2.576\) for \(99\%\) confidence.

How to build a confidence interval for a proportion

  1. Point estimate. Compute \(\hat p=\dfrac{x}{n}\) from the sample.
  2. Choose \(z\). Match the confidence level: \(1.96\) for \(95\%\), \(1.645\) for \(90\%\), \(2.576\) for \(99\%\).
  3. Standard error and margin. Find \(\sqrt{\hat p(1-\hat p)/n}\), then \(E=z\sqrt{\hat p(1-\hat p)/n}\).
  4. Form the interval. Report \(\hat p\pm E\), i.e. \((\hat p-E,\ \hat p+E)\); the width is \(2E\).
Sample size. To achieve a target margin of error, solve \(n\ge\dfrac{z^{2}\hat p(1-\hat p)}{E^{2}}\) and round up. With no estimate of \(p\), use \(\hat p=0.5\), which maximises \(\hat p(1-\hat p)\) and gives the safest sample size.
Example 1 — a \(95\%\) confidence interval
In a sample of \(250\) households, \(90\) have a streaming subscription. Find a \(95\%\) confidence interval for \(p\) (\(z=1.96\)).
Solution
Point estimate — use \(\hat p=\dfrac{x}{n}\):
\(\hat p\)\(=\)\(\dfrac{90}{250}\)
\(=\)\(0.36\)
Standard error — use \(\sqrt{\dfrac{\hat p(1-\hat p)}{n}}\):
\(\text{SE}\)\(=\)\(\sqrt{\dfrac{0.36\times 0.64}{250}}\)
\(=\)\(0.03036\)
Margin of error — use \(E=z\times\text{SE}\):
\(E\)\(=\)\(1.96\times 0.03036\)
\(=\)\(0.0595\)
Form the interval — \(\hat p\pm E\):
\(\text{CI}\)\(=\)\(0.36\pm 0.0595\)
\(=\)\((0.300,\ 0.420)\)
\(\therefore\) \(95\%\) CI: \((0.300,\ 0.420)\)
The 95% confidence interval (0.300, 0.420)A number line showing the interval from 0.300 to 0.420 with the point estimate 0.360 marked by a dot. 0.300 0.360 0.420
p^=0.36
Example 2 — margin of error and width
A poll of \(400\) people gives \(\hat p=0.5\). Find the \(95\%\) margin of error and the interval width.
Solution
Standard error — use \(\sqrt{\dfrac{\hat p(1-\hat p)}{n}}\):
\(\text{SE}\)\(=\)\(\sqrt{\dfrac{0.5\times 0.5}{400}}\)
\(=\)\(0.025\)
Margin of error — use \(E=z\times\text{SE}\):
\(E\)\(=\)\(1.96\times 0.025\)
\(=\)\(0.049\)
Interval width — \(2E\):
\(\text{width}\)\(=\)\(2\times 0.049\)
\(=\)\(0.098\)
\(\therefore\) margin of error \(0.049\), width \(0.098\)
E=0.049
Example 3 — effect of the confidence level
For \(\hat p=0.4\), \(n=300\), compare the \(95\%\) and \(99\%\) intervals.
Solution
Standard error — shared by both intervals, only \(z\) changes:
\(\text{SE}\)\(=\)\(\sqrt{\dfrac{0.4\times 0.6}{300}}\)
\(=\)\(0.02828\)
(i) \(95\%\) confidence \((z=1.96)\)
\(E\)\(=\)\(1.96\times 0.02828=0.0554\)
\(\text{CI}\)\(=\)\(0.4\pm 0.0554\)
\(=\)\((0.345,\,0.455)\)
\(\therefore\) \(95\%\) CI: \((0.345,\,0.455)\)
(ii) \(99\%\) confidence \((z=2.576)\)
\(E\)\(=\)\(2.576\times 0.02828=0.0729\)
\(\text{CI}\)\(=\)\(0.4\pm 0.0729\)
\(=\)\((0.327,\,0.473)\)
\(\therefore\) \(99\%\) CI: \((0.327,\,0.473)\)

Higher confidence \(\Rightarrow\) larger \(z\) \(\Rightarrow\) wider interval.

z=2.576
Example 4 — required sample size
What sample size gives a \(95\%\) margin of error of at most \(0.03\), using \(\hat p=0.5\)?
Solution
Sample-size inequality — use \(n\ge\dfrac{z^{2}\hat p(1-\hat p)}{E^{2}}\):
\(n\)\(\ge\)\(\dfrac{1.96^{2}\times 0.25}{0.03^{2}}\)
\(=\)\(1067.1\ldots\)
Round up to the next whole number:
\(n\)\(=\)\(1068\)
\(\therefore\) a sample of at least \(n=1068\) is needed
n=1068

Common pitfalls

Use \(\hat p\), not the true \(p\), in the standard error. The population proportion \(p\) is unknown, so the standard error is estimated with the sample proportion: \(\sqrt{\hat p(1-\hat p)/n}\).
Match \(z\) to the confidence level. Use \(1.96\) for \(95\%\), \(1.645\) for \(90\%\) and \(2.576\) for \(99\%\). Using the wrong \(z\) gives the wrong interval.
Margin of error vs width. The margin of error is \(E=z\times\text{SE}\); the interval width is \(2E\). The margin of error is half the width.
Round the sample size up. When solving for \(n\), round up to the next whole number — rounding down would make the margin of error exceed the target.
Interpret “\(95\%\) confidence” correctly. It means that in repeated sampling about \(95\%\) of such intervals contain \(p\); it is not a \(95\%\) probability that \(p\) lies in one particular interval already found.

Frequently asked questions

What is a confidence interval for a proportion?

An interval estimate for \(p\), calculated as \(\hat p\pm z\sqrt{\hat p(1-\hat p)/n}\), where \(\hat p=x/n\) and \(z\) is the standard-normal quantile for the confidence level.

What does 95% confidence mean?

If many samples were taken and an interval built from each, about \(95\%\) of those intervals would contain the true \(p\). It is not a probability for one particular interval.

Which z-value do I use?

\(1.96\) for \(95\%\), \(1.645\) for \(90\%\), \(2.576\) for \(99\%\). A higher confidence level uses a larger \(z\), giving a wider interval.

How is the margin of error related to the width?

The margin of error is \(E=z\sqrt{\hat p(1-\hat p)/n}\); the width is \(2E\), so the margin of error is half the width.

How do I find the required sample size?

Solve \(n\ge z^{2}\hat p(1-\hat p)/E^{2}\) and round up. With no estimate of \(p\), use \(\hat p=0.5\), which gives the largest (safest) sample size.

How do sample size and confidence level change the width?

A larger sample gives a narrower interval (width \(\propto 1/\sqrt{n}\)); a higher confidence level gives a wider interval.