Find a course

Module 4: Statistical InferenceLesson 9 of 1215 min

Confidence Intervals

Build confidence intervals for a proportion and a mean, interpret them correctly, and see how confidence level and sample size change the margin of error.

Step 1 of 14Learn

Estimate plus or minus

A news report says: "A poll of 1,200 adults found that 58% support the new park, with a margin of error of ±2.8 percentage points."

The 58% is a point estimate: our single best guess for the true percentage of all adults. But we know from the last lesson that another random sample would give a slightly different number. A single number hides that uncertainty.

A confidence interval shows it. It gives a range of plausible values for the parameter:

estimate ± margin of error

Here, 58% ± 2.8% gives an interval from 55.2% to 60.8%. The pollsters are saying: "We don't know the exact percentage, but values in this range are consistent with our data."

Every confidence interval in this course has the same structure:

statistic ± (critical value) × (standard error)

  • The statistic is the point estimate, like p̂ or x̄.
  • The standard error measures how much the statistic varies from sample to sample.
  • The critical value (like 1.96) sets how confident we want to be.

The margin of error only covers random sampling error. It says nothing about bias from poor question wording, nonresponse or a bad sampling frame. A biased poll with a tiny margin of error is still wrong.

Step 2 of 14Practice · Diagram

The park poll as an interval

A rival group claims true support is 62%. Tap the end of the interval that this claim lies beyond.

Tap the shape that answers the question, then press Check.

The park poll as an intervalScale: 55.2%, Point estimate 58%, 60.8%.95% confidence interval50525456586062646655.2%55.2%58%Point estimate 58%60.8%60.8%
55.2%

Lower end: 58 − 2.8.

Point estimate 58%

The sample percentage, our single best guess.

60.8%

Upper end: 58 + 2.8.

Step 3 of 14Learn

A confidence interval for a proportion

For a population proportion p, the confidence interval is:

**p̂ ± z* × √( p̂(1 − p̂) / n )**

Common critical values z*:

Confidence levelz*
90%1.645
95%1.96
99%2.576

These come straight from the normal curve: 95% of the area under a standard normal curve lies between −1.96 and 1.96.

Worked example. In the park poll, p̂ = 0.58 and n = 1,200.

  1. Standard error: √(0.58 × 0.42 / 1200) = √0.000203 ≈ 0.0142
  2. Margin of error at 95%: 1.96 × 0.0142 ≈ 0.028, or 2.8 points
  3. Interval: 0.58 ± 0.028, which is (0.552, 0.608)

Conditions to check first:

  • Random: the data come from a random sample or randomized experiment.
  • Large enough: at least 10 successes and 10 failures in the sample (n p̂ ≥ 10 and n(1 − p̂) ≥ 10), so the normal approximation works.
  • Independent: if sampling without replacement, the sample is less than 10% of the population.

Here, 696 said yes and 504 said no, both far above 10, and 1,200 is a tiny fraction of all adults. The conditions are met.

Step 4 of 14Try the calculator

Confidence interval for a proportion

Enter a sample proportion, a sample size and a critical value (1.645 for 90%, 1.96 for 95%, 2.576 for 99%). Try quadrupling n and watch the margin of error halve.

Standard error
0.0142
Margin of error
0.0279
Lower bound
0.552
Upper bound
0.608

Step 5 of 14Practice · Work it out

A random sample of 600 students finds that 40% work part-time (p̂ = 0.40). What is the margin of error for a 95% confidence interval? Give a decimal to three places.

Step 6 of 14Learn

What "95% confident" really means

Here's the correct interpretation of the park interval:

"We are 95% confident that the interval from 55.2% to 60.8% captures the true percentage of all adults who support the new park."

What does the 95% refer to? It describes the method, not this one interval. If pollsters took many random samples and built a 95% interval from each, about 95% of those intervals would capture the true proportion, and about 5% would miss it. We don't know whether ours is one of the hits, but the method succeeds 95% of the time.

The true proportion is a fixed number. It doesn't bounce around; the intervals do. That's why statisticians avoid saying "there's a 95% probability that p is between 0.552 and 0.608." Once the interval is computed, p is either in it or not.

Common wrong interpretations:

  • "95% of adults support the park somewhere between 55% and 61%." (Mixes up the confidence level with the data.)
  • "95% of sample proportions fall in this interval." (The interval is about the parameter, not other samples.)
  • "There's a 95% chance the next poll will be in this range." (Not what it measures.)

A useful habit: always say what parameter the interval estimates, for what population, in context.

Step 7 of 14Practice · True or false

If a researcher builds 100 different 95% confidence intervals from 100 independent random samples, about 95 of them should capture the true parameter.

Step 8 of 14Diagram

"95% confident" describes the method

"95% confident" describes the methodProcess diagram: Draw a random sample → Build p̂ ± margin → Repeat many times → ~95 intervals capture p → Yours: in or out.Draw a random sampleBuild p̂ ± marginRepeat many times~95 intervalscapture pYours: in or out

Tap a shape with to see more.

Draw a random sample
Build p̂ ± margin

Each sample gives a slightly different center and so a different interval.

Repeat many times

Picture 100 pollsters doing the same study.

~95 intervals capture p

The 95% is the long-run success rate of the recipe.

Yours: in or out

A single interval either contains p or it does not; you just do not know which.

Step 9 of 14Learn

A confidence interval for a mean

For a population mean μ, the interval has the same structure:

**x̄ ± t* × s/√n**

Why t* instead of z*? We almost never know the population standard deviation σ, so we use the sample standard deviation s. That adds extra uncertainty, especially in small samples. To account for it, we use the t distribution: a bell-shaped curve like the normal, but with heavier tails.

The t distribution depends on the degrees of freedom, df = n − 1. With few degrees of freedom, its tails are fat and t* is larger than 1.96. As n grows, the t distribution gets closer to the normal:

df95% t*
92.262
152.131
242.064
602.000
very large1.960

Worked example. A random sample of 25 commuters has mean commute x̄ = 31 minutes and s = 10 minutes.

  1. SE = s/√n = 10/√25 = 2 minutes
  2. df = 24, so t* = 2.064
  3. Margin of error = 2.064 × 2 ≈ 4.13
  4. Interval: 31 ± 4.13, which is (26.9, 35.1) minutes

Conditions: a random sample, and either a roughly normal population or a large sample (n ≥ 30, by the CLT). For a small sample, check a dotplot for strong skew or outliers, which make the t interval unreliable.

Step 10 of 14Practice · Work it out

A random sample of n = 16 batteries has mean life 72 hours and standard deviation s = 8 hours. Using t* = 2.131, what is the margin of error for a 95% confidence interval for the mean? Give two decimal places.

Step 11 of 14Learn

What controls the width

A narrow interval is more useful than a wide one: "between 55% and 61%" says more than "between 40% and 76%." Three things control the width:

  1. Confidence level. Higher confidence requires a wider interval. To be 99% sure of catching the parameter, you need a bigger net than for 90%. With p̂ = 0.58 and n = 1,200, the 90% interval is ±2.3 points and the 99% interval is ±3.7 points.
  2. Sample size. Larger samples give narrower intervals, because the standard error has √n in its denominator. Quadrupling n halves the margin of error.
  3. Variability in the data. More spread (a bigger s) means a wider interval for a mean. For proportions, variability is largest when p̂ is near 0.5.

Planning a study. You can solve for the sample size needed for a given margin of error. For a proportion, using the conservative guess p̂ = 0.5:

**n = (z* / ME)² × 0.25**

For a 95% margin of error of 3 points: n = (1.96/0.03)² × 0.25 ≈ 1,067. That's why so many national polls interview roughly 1,000 people.

There's no free lunch: the only way to get both high confidence and a narrow interval is to collect more data.

Step 12 of 14Practice · Sort into groups

Holding everything else constant, does each change make a confidence interval wider or narrower?

Tap an item, then tap its group (or drag it there).

Step 13 of 14Practice · Chart

95% margin of error for a proportion near 50%

Computed from 1.96 × √(0.25/n). Quadrupling n from 100 to 400 halves the margin; going from 1,600 to 2,500 buys only half a point.

Tap the sample size whose margin is half that of n = 100.

Tap the point that answers the question, then press Check.

95% margin of error for a proportion near 50%Line chart with 5 categories: 100: 9.8%; 400: 4.9%; 900: 3.3%; 1,600: 2.5%; 2,500: 2%.0%2%4%6%8%10%1004009001,6002,500Sample size n
95% margin of error for a proportion near 50%
Sample size nMargin of error
1009.8%
4004.9%
9003.3%
1,6002.5%
2,5002%

Step 14 of 14Practice · Choose one

A 95% confidence interval for the mean weekly study time of all students at a college is (11.2, 14.6) hours. Which interpretation is correct?