impera Open Impera

AP Statistics · Inference for categorical data: proportions

Confidence intervals for proportions

1The idea of a confidence interval

A point estimate (such as $\hat{p}$) is a single best guess for a parameter. A confidence interval gives a range of plausible values:

$$\text{point estimate} \pm \text{margin of error}$$

$$\text{margin of error} = \text{critical value} \times \text{standard error}$$

The confidence level (such as 95%) is the long-run success rate of the method: if we took many random samples and built a 95% interval from each, about 95% of the intervals would capture the true parameter.

Twenty 95% intervals from different samples of 1,200 adults: most, but not all, capture p

Check yourself

A 95% confidence level means:

  • 95% of the data lie in the interval

  • About 95% of intervals made this way capture the true parameter

  • There is a 95% chance p is in this particular interval

  • The sample proportion is 95% accurate

Show the answer

About 95% of intervals made this way capture the true parameter

It describes the method.

2One-sample z-interval for p

$$\hat{p} \pm z^*\sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}$$

Common critical values: 90% → $z^* = 1.645$; 95% → $1.960$; 99% → $2.576$.

Conditions:

  • Random: data from a random sample or randomised experiment.
  • 10%: $n \le 10\%$ of the population (sampling without replacement).
  • Large Counts: $n\hat{p} \ge 10$ and $n(1 - \hat{p}) \ge 10$ (use $\hat{p}$, because $p$ is unknown).
Worked example

in a random sample of 1,200 adults, 540 say they read a printed book last month.

  1. $\hat{p} = 0.45$. Conditions: random; 1,200 < 10% of all adults; 540 and 660 ≥ 10.
  2. $SE = \sqrt{\frac{0.45 \times 0.55}{1200}} \approx 0.0144$.
  3. $ME = 1.96 \times 0.0144 \approx 0.028$.
  4. Interval: $(0.422, 0.478)$.
  5. Interpret: "We are 95% confident that the interval from 0.422 to 0.478 captures the true proportion of all adults who read a printed book last month."
Check yourself

Which value of z* is used for a 99% interval?

  • 1.960

  • 2.326

  • 2.576

  • 1.645

Show the answer

2.576

Wider for more confidence.

3Margin of error and sample size

The margin of error gets smaller when:

  • the sample size $n$ increases;
  • the confidence level decreases.

To choose $n$ for a desired margin of error $M$, solve $z^*\sqrt{\frac{p^*(1 - p^*)}{n}} \le M$. If there is no prior estimate, use $p^* = 0.5$, which gives the largest (safest) $n$.

Worked example

margin of error at most 0.03 with 95% confidence.

  1. $1.96\sqrt{\frac{0.25}{n}} \le 0.03$, so $n \ge \left(\frac{1.96}{0.03}\right)^2(0.25) \approx 1067.1$.
  2. Round up: $n = 1068$.

The margin of error only covers sampling variability. It does not account for bias (undercoverage, nonresponse, wording).

Check yourself

To halve the margin of error, n must be:

  • Multiplied by 4

  • Doubled

  • Multiplied by 8

  • Halved

Show the answer

Multiplied by 4

ME ∝ 1/√n.

4Two-sample z-interval for p₁ − p₂

$$(\hat{p}_1 - \hat{p}_2) \pm z^*\sqrt{\frac{\hat{p}_1(1 - \hat{p}_1)}{n_1} + \frac{\hat{p}_2(1 - \hat{p}_2)}{n_2}}$$

Conditions: two independent random samples (or random assignment), 10% for each, large counts for both groups.

Worked example

120 of 300 city residents and 90 of 300 rural residents support a new tax.

  1. $\hat{p}_1 - \hat{p}_2 = 0.40 - 0.30 = 0.10$.
  2. $SE = \sqrt{\frac{0.4(0.6)}{300} + \frac{0.3(0.7)}{300}} = \sqrt{0.0015} \approx 0.0387$.
  3. 95% interval: $0.10 \pm 0.076 = (0.024, 0.176)$.
  4. Since the interval lies entirely above 0, it gives convincing evidence that support is higher in the city.
Check yourself

A 95% CI for p₁ − p₂ is (−0.03, 0.08). This suggests:

  • p₂ is definitely larger than p₁, as the interval includes negatives

  • The samples are biased, since the interval contains zero

  • No convincing evidence of a difference, since 0 is plausible

  • p₁ is definitely larger than p₂, as most of the interval is positive

Show the answer

No convincing evidence of a difference, since 0 is plausible

0 is inside the interval.

5Going deeper: the four-step process, interpreting correctly and planning sample size

A confidence interval gives a range of plausible values for a parameter:

point estimate ± margin of error, where margin of error = critical value × standard error.

One-sample z interval for a proportion

$$\hat{p} \pm z^*\sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}$$

Critical values: 1.645 (90%), 1.960 (95%), 2.576 (99%).

The four-step process

State: the parameter (in context) and the confidence level.

Plan: name the procedure and check conditions.

  • Random: random sample (or random assignment).
  • 10%: n ≤ 10% of the population.
  • Large counts: $n\hat{p}$ ≥ 10 and $n(1 - \hat{p})$ ≥ 10: the observed numbers of successes and failures.

Do: calculate.

Conclude: interpret in context.

Worked example

in a random sample of 1000 adults in a large country, 520 say they support a proposed law. Construct a 95% confidence interval.

  1. State: p = the true proportion of all adults in the country who support the law; 95% confidence.
  2. Plan: one-sample z interval for p. Random: stated. 10%: 1000 is far less than 10% of all adults. Large counts: 520 and 480 are both at least 10.
  3. Do: $\hat{p}$ = 0.52. Standard error = √(0.52 × 0.48 ÷ 1000) = 0.0158. Margin of error = 1.96 × 0.0158 = 0.031. Interval: (0.489, 0.551).
  4. Conclude: We are 95% confident that the interval from 0.489 to 0.551 captures the true proportion of all adults in the country who support the law.

Using the interval to assess a claim: a newspaper says "a majority supports the law." Since the interval includes values at and below 0.50, the data do not give convincing evidence of a majority.

Interpreting the confidence level: "If we took many random samples of 1000 adults and built a 95% confidence interval from each, about 95% of those intervals would capture the true proportion."

What a confidence level is not

  • Not "there is a 95% probability that p is in this interval." The parameter is fixed; a particular interval either contains it or does not.
  • Not "95% of adults are between 48.9% and 55.1%."
  • Not "95% of sample proportions fall in this interval."

What the margin of error covers: only sampling variability. It does not cover bias from undercoverage, nonresponse or badly worded questions.

What changes the width?

  • Higher confidence: larger z*, wider interval. More confidence costs precision.
  • Larger sample: smaller standard error, narrower interval. Four times the sample halves the margin.
  • $\hat{p}$ near 0.5 gives the largest standard error.

Choosing a sample size: for a desired margin of error ME,

$$n = \left(\frac{z^*}{ME}\right)^2 p^*(1 - p^*)$$

Use a prior estimate for p*, or 0.5 if none is available (it gives the largest, safest n). Always round up.

Worked example

how many people must be surveyed to estimate a proportion to within 3 percentage points with 95% confidence?

  1. n = (1.96 ÷ 0.03)² × 0.5 × 0.5 = 4268.4 × 0.25 = 1067.1.
  2. Round up: 1068.
  3. For a margin of 1.5 points (half as large), about four times as many: 4269.

Two-sample z interval for a difference of proportions

$$(\hat{p}_1 - \hat{p}_2) \pm z^*\sqrt{\frac{\hat{p}_1(1 - \hat{p}_1)}{n_1} + \frac{\hat{p}_2(1 - \hat{p}_2)}{n_2}}$$

Conditions: two independent random samples (or two randomly assigned groups); the 10% condition for each; all four observed counts at least 10.

Worked example

45 of 150 patients on a new drug and 30 of 150 on the standard drug improve. Find a 95% interval for the difference.

  1. $\hat{p}_1$ = 0.30; $\hat{p}_2$ = 0.20; difference 0.10.
  2. Standard error = √(0.21 ÷ 150 + 0.16 ÷ 150) = √0.002467 = 0.0497.
  3. Margin = 1.96 × 0.0497 = 0.097. Interval: (0.003, 0.197).
  4. We are 95% confident that the new drug's improvement rate is between 0.3 and 19.7 percentage points higher than the standard drug's. Since 0 is not in the interval, there is evidence of a difference.

Common mistakes

  • Interpreting the level as a probability about one interval.
  • Defining the parameter as the sample proportion.
  • Checking large counts with a hypothesized p (that is for tests) or forgetting conditions altogether.
  • Rounding a sample size down.
  • Saying the margin of error accounts for all errors in a survey.
  • Omitting context from the conclusion.
Check yourself

A 95% confidence interval for a proportion is (0.42, 0.50). Which change would make the interval narrower?

  • Increasing the confidence level to 99%

  • Using a different random sample of the same size

  • Increasing the sample size

  • Decreasing the sample size

Show the answer

Increasing the sample size

A larger sample reduces the standard error and so the margin of error.

6For top marks

  • Follow four steps: State (parameter and confidence level), Plan (name the procedure and check conditions), Do (calculate), Conclude (interpret in context).
  • Define the parameter: "$p$ = the true proportion of all adults in the country who…".
  • Interpret the interval and, if asked, the confidence level separately.
  • Never say "there is a 95% probability that $p$ is in this interval".
Example

"The interval (0.024, 0.176) does not include 0, so it is plausible that city support exceeds rural support by between 2.4 and 17.6 percentage points."

Check yourself

Which is the correct interpretation of an interval?

  • The true proportion varies within the interval

  • We are 95% confident the interval captures the true proportion

  • There is a 95% chance p̂ is in the interval

  • 95% of samples have p̂ in the interval

Show the answer

We are 95% confident the interval captures the true proportion

Talk about capturing the parameter.

Now test yourself

This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.

Practise in Impera