Lessons and exercises follow the school system and stay in its language.Les leçons et les exercices suivent le système scolaire et restent dans sa langue.Lektionen und Übungen folgen dem Schulsystem und bleiben in seiner Sprache.

Confidence intervals

Print the chapter

Every lesson of the chapter, ready for paper. Exercise sets are lettered A, B, C… and answered at the end.

To save a PDF, choose “Save as PDF” in the print dialog.

1. Point estimates and margins of error

Warm-up

Three quick questions from earlier lessons.

  1. The population proportion is p = 8/10. Find the standard deviation of p̂ for random samples of size 83.
  2. The population proportion is p = 5/10. What is the mean of the sampling distribution of p̂ for samples of size 351?
  3. The population proportion is p = 1/8. What is the smallest sample size n for which np ≥ 10 and n(1 − p) ≥ 10?

Discover

A poll reports 52% support, "plus or minus 3 points". Which range of values is plausible for the true support?

  1. 49% to 55%
  2. 52% to 55%

Key idea

An interval estimate: point estimate ± margin of error.

A confidence interval is estimate±margin of error\text{estimate} \pm \text{margin of error}, with margin of error =(critical value)×(standard error)= (\text{critical value}) \times (\text{standard error}). The point estimate is the center of the interval; the margin of error is half its width. Larger samples give smaller margins.

Worked example

Interval (0.42, 0.50).

Point estimate =0.46= 0.46
Center.
Margin of error =0.04= 0.04
Half the width.
0.46±0.040.46 \pm 0.04
Written as estimate ± ME.

Your turn, guided

Your turn: interval (12, 20). The margin of error.

44
(20 − 12)/2.

Practice ★

  1. A 95% confidence interval for a proportion is (47/100, 51/100). Find the margin of error.
  2. A 95% confidence interval for a proportion is (76/100, 102/100). Find the margin of error.
  1. A confidence interval for a mean is (30, 40). Find the point estimate.

Watch out!

Practice ★★

  1. A 95% interval from a sample of 591 is too wide. Which change makes it narrower?
    1. A larger sample size
    2. A higher confidence level, such as 99%
    3. Nothing: the width is fixed by the population

Exit ticket

Three questions to check you have got it.

  1. A 95% confidence interval for a proportion is (47/100, 51/100). Find the margin of error.
  2. A 95% confidence interval for a proportion is (76/100, 102/100). Find the margin of error.
  3. A 95% confidence interval for a proportion is (43/100, 47/100). Find the margin of error.

Summary card

Interval estimates

Estimate ± ME, ME = critical value × SE; ME = half the width.

Watch out: width = 2 × ME.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. By what factor must the sample size grow to divide the margin of error by 3?

2. Confidence intervals for a proportion

Warm-up

Three quick questions from earlier lessons.

  1. A 95% confidence interval for a proportion is (47/100, 51/100). Find the margin of error.
  2. A confidence interval for a mean is (30, 40). Find the point estimate.
  3. A 95% interval from a sample of 591 is too wide. Which change makes it narrower?
    1. A larger sample size
    2. A higher confidence level, such as 99%
    3. Nothing: the width is fixed by the population

Discover

In a sample of 400, p̂ = 0.5. The standard error is 0.5×0.5/400=0.025\sqrt{0.5 \times 0.5 / 400} = 0.025. For 95% confidence (z* ≈ 2), what is the margin of error?

  1. 0.05
  2. 0.025

Key idea

The one-proportion z interval.

p^±z∗p^(1−p^)n\hat{p} \pm z^*\sqrt{\dfrac{\hat{p}(1 - \hat{p})}{n}}, for a random sample with np^≥10n\hat{p} \ge 10 and n(1−p^)≥10n(1 - \hat{p}) \ge 10. For 95% confidence, z∗=1.96z^* = 1.96. Interpret: "we are 95% confident that the interval captures the population proportion".

Worked example

n=100n = 100, p^=0.3\hat{p} = 0.3, 95%.

SE≈0.0458SE \approx 0.0458
√(0.3 × 0.7/100).
ME≈0.090ME \approx 0.090
1.96 × SE.
(0.210,0.390)(0.210, 0.390)
0.3 ± 0.090.

Your turn, guided

Your turn: SE = 0.02 and z* = 2. The margin of error.

0.040.04
2 × 0.02.

Practice ★

  1. In a random sample of 400, p̂ = 5/10. Using z* = 1.96, find the margin of error of a 95% interval for p.
  2. In a random sample of 400, p̂ = 9/10. Using z* = 1.96, find the margin of error of a 95% interval for p.
  1. In a random sample of 100, p̂ = 3/10. Using z* = 2, find the upper end of the approximate 95% interval for p.

Watch out!

Practice ★★

  1. A 95% confidence interval for the proportion of voters who support a plan is (0.48, 0.52). Which interpretation is right?
    1. We are 95% confident that the interval from 0.48 to 0.52 captures the true proportion of supporters
    2. 95% of the sample supports the plan
    3. There is a 95% probability that p is between 0.48 and 0.52

Exit ticket

Three questions to check you have got it.

  1. In a random sample of 400, p̂ = 5/10. Using z* = 1.96, find the margin of error of a 95% interval for p.
  2. In a random sample of 400, p̂ = 9/10. Using z* = 1.96, find the margin of error of a 95% interval for p.
  3. In a random sample of 400, p̂ = 8/10. Using z* = 1.96, find the margin of error of a 95% interval for p.

Summary card

Interval for p

p^±z∗p^(1−p^)/n\hat{p} \pm z^*\sqrt{\hat{p}(1 - \hat{p})/n}; check random and large counts.

Watch out: "confident", not "probability", for a computed interval.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. Using p^=0.5\hat{p} = 0.5 and z∗=2z^* = 2, how large must a sample be for a margin of error of 150\dfrac{1}{ 50 }?

3. Confidence level and critical values

Warm-up

Three quick questions from earlier lessons.

  1. In a random sample of 400, p̂ = 5/10. Using z* = 1.96, find the margin of error of a 95% interval for p.
  2. In a random sample of 100, p̂ = 3/10. Using z* = 2, find the upper end of the approximate 95% interval for p.
  3. A 95% confidence interval for the proportion of voters who support a plan is (0.48, 0.52). Which interpretation is right?
    1. We are 95% confident that the interval from 0.48 to 0.52 captures the true proportion of supporters
    2. 95% of the sample supports the plan
    3. There is a 95% probability that p is between 0.48 and 0.52

Discover

To be more confident of catching a fish, should you use a wider or a narrower net?

  1. Wider
  2. Narrower

Key idea

The confidence level describes the method.

Common critical values: z∗=1.645z^* = 1.645 (90%), 1.961.96 (95%), 2.5762.576 (99%). Higher confidence gives a wider interval. The confidence level is the proportion of intervals, in repeated random sampling, that capture the parameter.

Worked example

p^=0.6\hat{p} = 0.6, SE=0.04SE = 0.04.

90%: ME ≈ 0.066
1.645 × 0.04.
95%: ME ≈ 0.078
1.96 × 0.04.
99%: ME ≈ 0.103
2.576 × 0.04.

Your turn, guided

Your turn: SE = 0.05, 95% (z* = 2 approx). The margin of error.

0.10.1
2 × 0.05.

Practice ★

  1. From the same sample of 458, a 99% and a 90% interval are computed. Which is wider?
    1. The 99% interval
    2. The 90% interval
    3. They have the same width
  1. A 95% interval (z* = 1.96) has margin of error 0.07. From the same data, find the margin of error of a 99% interval (z* = 2.576).
  2. A 95% interval (z* = 1.96) has margin of error 0.06. From the same data, find the margin of error of a 99% interval (z* = 2.576).

Watch out!

Practice ★★

  1. What does the confidence level 90% mean?
    1. In repeated random sampling, about 90% of the intervals built this way capture the parameter
    2. This interval contains the parameter with probability 90%
    3. 90% of the data fall in the interval

Exit ticket

Three questions to check you have got it.

  1. A 95% interval (z* = 1.96) has margin of error 0.07. From the same data, find the margin of error of a 99% interval (z* = 2.576).
  2. A 95% interval (z* = 1.96) has margin of error 0.06. From the same data, find the margin of error of a 99% interval (z* = 2.576).
  3. A 95% interval (z* = 1.96) has margin of error 0.09. From the same data, find the margin of error of a 99% interval (z* = 2.576).

Summary card

Confidence level

z∗z^*: 1.645, 1.96, 2.576. Higher confidence, wider interval.

Watch out: the level describes the method over many samples.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. A 95% interval (z* = 1.96) has margin of error 0.07. From the same data, find the margin of error of a 90% interval (z* = 1.645).

4. Choosing a sample size

Warm-up

Three quick questions from earlier lessons.

  1. In a random sample of 400, p̂ = 5/10. Using z* = 1.96, find the margin of error of a 95% interval for p.
  2. In a random sample of 100, p̂ = 3/10. Using z* = 2, find the upper end of the approximate 95% interval for p.
  3. A 95% confidence interval for the proportion of voters who support a plan is (0.48, 0.52). Which interpretation is right?
    1. We are 95% confident that the interval from 0.48 to 0.52 captures the true proportion of supporters
    2. 95% of the sample supports the plan
    3. There is a 95% probability that p is between 0.48 and 0.52

Discover

A survey of 100 has margin of error 0.10. About how many people give a margin of 0.05?

  1. 400
  2. 200

Key idea

Plan the sample size before collecting data.

To get margin of error at most MEME for a proportion: n≥(z∗ME)2p(1−p)n \ge \left(\dfrac{z^*}{ME}\right)^2 p(1 - p), using a prior estimate of pp or p=0.5p = 0.5 (the safest choice), then round up.

Worked example

95% confidence, ME = 0.03, p=0.5p = 0.5.

≈4268.4\approx 4268.4
(1.96/0.03)².
≈1067.1\approx 1067.1
× 0.25.
n=1068n = 1068
Round up.

Your turn, guided

Your turn: with z∗=2z^* = 2, ME = 0.1, p=0.5p = 0.5: (2/0.1)2×0.25(2/0.1)^2 \times 0.25.

n=100n = 100
400 × 0.25.

Practice ★

  1. A survey of 264 people gives a margin of error you want to halve. About how many people are needed?
    1. 1056
    2. 528
    3. About half as many
  1. A margin of error is 0.08. If the sample size is multiplied by 9, what is the new margin of error?
  2. A margin of error is 0.07. If the sample size is multiplied by 25, what is the new margin of error?

Watch out!

Practice ★★

  1. Using p = 0.5 and z* = 1.96, find the value of n (before rounding up) needed for a margin of error of 0.04.

Exit ticket

Three questions to check you have got it.

  1. A margin of error is 0.08. If the sample size is multiplied by 9, what is the new margin of error?
  2. A margin of error is 0.07. If the sample size is multiplied by 25, what is the new margin of error?
  3. A margin of error is 0.07. If the sample size is multiplied by 4, what is the new margin of error?

Summary card

Sample size

n≥(z∗/ME)2p(1−p)n \ge (z^*/ME)^2 p(1 - p), p=0.5p = 0.5 if unknown; round up.

Watch out: halving ME needs 4 times the sample.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. A pilot study gives p̂ = 0.3. Using z* = 2, which sample size nn gives a margin of error of 120\dfrac{1}{ 20 }?

5. t intervals for a mean

Warm-up

Three quick questions from earlier lessons.

  1. From the same sample of 458, a 99% and a 90% interval are computed. Which is wider?
    1. The 99% interval
    2. The 90% interval
    3. They have the same width
  2. What does the confidence level 90% mean?
    1. In repeated random sampling, about 90% of the intervals built this way capture the parameter
    2. This interval contains the parameter with probability 90%
    3. 90% of the data fall in the interval
  3. A 95% interval (z* = 1.96) has margin of error 0.07. From the same data, find the margin of error of a 99% interval (z* = 2.576).

Discover

To estimate a mean we usually do not know σ, so we use the sample's ss. Does that add uncertainty?

  1. Yes: we use a slightly larger t critical value
  2. No: s is just as good as σ

Key idea

The one-sample t interval.

xˉ±t∗sn\bar{x} \pm t^*\dfrac{s}{\sqrt{n}}, with t∗t^* from the t distribution with n−1n - 1 degrees of freedom. Conditions: random sample; population roughly normal or nn large (about 30 or more), with no strong outliers for small nn.

Worked example

n=16n = 16, xˉ=50\bar{x} = 50, s=8s = 8, t∗=2.131t^* = 2.131 (15 df, 95%).

SE=2SE = 2
8/4.
ME=4.262ME = 4.262
2.131 × 2.
(45.738,54.262)(45.738, 54.262)
50 ± 4.262.

Your turn, guided

Your turn: n=9n = 9, s=6s = 6. The standard error.

22
6/√9.

Practice ★

  1. A random sample of 25 has standard deviation s = 16. With t* = 2.064 (24 df, 95%), find the margin of error for the mean.
  2. A random sample of 25 has standard deviation s = 13. With t* = 2.064 (24 df, 95%), find the margin of error for the mean.
  1. A one-sample t interval uses a sample of 10. How many degrees of freedom?

Watch out!

Practice ★★

  1. Why is a t critical value used for a confidence interval for a mean from a sample of 40?
    1. Because σ is estimated by s, which adds variability
    2. Because n is less than 1,000
    3. Because the data are skewed

Exit ticket

Three questions to check you have got it.

  1. A random sample of 25 has standard deviation s = 16. With t* = 2.064 (24 df, 95%), find the margin of error for the mean.
  2. A random sample of 25 has standard deviation s = 13. With t* = 2.064 (24 df, 95%), find the margin of error for the mean.
  3. A random sample of 25 has standard deviation s = 19. With t* = 2.064 (24 df, 95%), find the margin of error for the mean.

Summary card

t interval for μ

xˉ±t∗s/n\bar{x} \pm t^* s/\sqrt{n}, df =n−1= n - 1.

Watch out: t*, not z*, when σ is estimated.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. A random sample of 16 has standard deviation s = 10. With t* = 2.131 (15 df, 95%), find the width of the t interval for the mean.

6. Intervals for a difference of proportions or means

Warm-up

Three quick questions from earlier lessons.

  1. In a random sample of 400, p̂ = 5/10. Using z* = 1.96, find the margin of error of a 95% interval for p.
  2. In a random sample of 100, p̂ = 3/10. Using z* = 2, find the upper end of the approximate 95% interval for p.
  3. A 95% confidence interval for the proportion of voters who support a plan is (0.48, 0.52). Which interpretation is right?
    1. We are 95% confident that the interval from 0.48 to 0.52 captures the true proportion of supporters
    2. 95% of the sample supports the plan
    3. There is a 95% probability that p is between 0.48 and 0.52

Discover

A 95% interval for p1−p2p_1 - p_2 is (0.02, 0.10). What does it suggest about the two proportions?

  1. p1p_1 appears larger
  2. No difference

Key idea

Compare two groups with an interval for the difference.

(p^1−p^2)±z∗p^1(1−p^1)n1+p^2(1−p^2)n2(\hat{p}_1 - \hat{p}_2) \pm z^*\sqrt{\dfrac{\hat{p}_1(1 - \hat{p}_1)}{n_1} + \dfrac{\hat{p}_2(1 - \hat{p}_2)}{n_2}}; for means (xˉ1−xˉ2)±t∗s12n1+s22n2(\bar{x}_1 - \bar{x}_2) \pm t^*\sqrt{\dfrac{s_1^2}{n_1} + \dfrac{s_2^2}{n_2}}. If 0 is in the interval, "no difference" is plausible.

Worked example

p^1=0.6\hat{p}_1 = 0.6, p^2=0.5\hat{p}_2 = 0.5, n1=n2=100n_1 = n_2 = 100.

SE=0.0049=0.07SE = \sqrt{0.0049} = 0.07
0.0024 + 0.0025.
ME≈0.137ME \approx 0.137
1.96 × 0.07.
(−0.037,0.237)(-0.037, 0.237): no convincing difference
0.1 ± 0.137 contains 0.

Your turn, guided

Your turn: variances of the two estimates are 0.0009 and 0.0016. The SE of the difference.

0.050.05
√0.0025.

Practice ★

  1. Two groups have sample means 90 and 58. What is the point estimate of μ₁ − μ₂?
  1. Independent samples of 100 give p̂₁ = 1/10 and p̂₂ = 6/10. Using z* = 1.96, find the margin of error for p₁ − p₂.
  2. Independent samples of 100 give p̂₁ = 3/10 and p̂₂ = 8/10. Using z* = 1.96, find the margin of error for p₁ − p₂.

Watch out!

Practice ★★

  1. A 95% interval for p₁ − p₂ is (−0.07, 0.08). What does it suggest?
    1. No convincing difference: 0 is a plausible value of p₁ − p₂
    2. p₁ is larger, since the upper end is positive
    3. It proves p₁ = p₂

Exit ticket

Three questions to check you have got it.

  1. Independent samples of 100 give p̂₁ = 1/10 and p̂₂ = 6/10. Using z* = 1.96, find the margin of error for p₁ − p₂.
  2. Independent samples of 100 give p̂₁ = 3/10 and p̂₂ = 8/10. Using z* = 1.96, find the margin of error for p₁ − p₂.
  3. Independent samples of 100 give p̂₁ = 7/10 and p̂₂ = 8/10. Using z* = 1.96, find the margin of error for p₁ − p₂.

Summary card

Intervals for differences

Estimate difference ± critical value × √(sum of variances).

Watch out: does the interval contain 0?

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. Independent samples of 25 have SDs 6 and 8. Using a critical value of 2, find the margin of error for μ₁ − μ₂.

7. A quick margin of error

Discover

A poll of nn people gives a margin of error. Without the formula, what happens to the margin when you poll 4 times as many people?

  1. It is halved
  2. It is divided by 4

Key idea

A quick margin of error.

For a proportion at 95 % confidence,

ME=1.96p^(1−p^)n≤1.960.25n≈1nME = 1.96\sqrt{\dfrac{\hat{p}(1 - \hat{p})}{n}} \le 1.96\sqrt{\dfrac{0.25}{n}} \approx \dfrac{1}{\sqrt{n}}.

So a sample of nn gives a margin of at most about 1n\dfrac{1}{\sqrt{n}}, and a margin mm needs about n=1m2n = \dfrac{1}{m^2}.

Worked example

How many people for a margin of 3 percentage points?

n≈10.0009n \approx \dfrac{1}{0.0009}
m=0.03m = 0.03.
≈1111\approx 1111 people
Divide.

Your turn, guided

Your turn: quick margin for n=400n = 400?

0.050.05, about 5 points
1400\dfrac{1}{\sqrt{400}}.

Practice ★

  1. Using the quick rule ME≈1nME \approx \dfrac{1}{\sqrt{n}}, find the margin of error for a poll of 729 people (as a decimal).
  2. Using the quick rule ME≈1nME \approx \dfrac{1}{\sqrt{n}}, find the margin of error for a poll of 1764 people (as a decimal).
  3. Using the quick rule ME≈1nME \approx \dfrac{1}{\sqrt{n}}, find the margin of error for a poll of 484 people (as a decimal).

Practice ★★

  1. Using n≈1m2n \approx \dfrac{1}{m^2}, how many people give a margin of about 1 percentage points?
  2. Using n≈1m2n \approx \dfrac{1}{m^2}, how many people give a margin of about 2 percentage points?

Exit ticket

Two questions to check.

  1. Using the quick rule ME≈1nME \approx \dfrac{1}{\sqrt{n}}, find the margin of error for a poll of 729 people (as a decimal).
  2. Using the quick rule ME≈1nME \approx \dfrac{1}{\sqrt{n}}, find the margin of error for a poll of 1764 people (as a decimal).

Summary card

Quick margin

  • ME⪅1nME \lessapprox \dfrac{1}{\sqrt{n}} at 95 %.
  • n≈1m2n \approx \dfrac{1}{m^2}.

This is the arithmetic behind '±3 points' in news polls.

8. History of confidence intervals: Gosset and Neyman

Discover

A study says 'the average is between 12 and 15, with 95 % confidence'. In the 1930s, Jerzy Neyman made this kind of statement precise. What does the 95 % refer to?

  1. The method: 95 % of intervals built this way contain the true value
  2. A 95 % chance that the true value moves into the interval

Key idea

From brewing to confidence intervals.

190019101920193019401899Gosset1899Gosset
  1. Step 1190019101920193019401899Gosset1899GossetWilliam Sealy Gosset 1876–1937Unknown artist. Public domain1899: Gosset joins Guinness; he invents the t-test for small samples and writes as 'Student'.
  2. Step 2190019101920193019401899Gosset1934Neyman1899Gosset1934NeymanJerzy Neyman 1894–1981No portrait is known1934–38: Neyman puts forward the theory of confidence intervals.

William Gosset, a chemist at the Guinness brewery from 1899, invented the t-test to handle small samples for quality control in brewing, and published under the name 'Student'. Between 1934 and 1938, in London, Jerzy Neyman put forward the theory of confidence intervals.

Worked example

A 95 % confidence interval is (12,15)(12, 15). Find the point estimate and the margin of error.

12+152=13.5\dfrac{12 + 15}{2} = 13.5
Middle of the interval.
15−122=1.5\dfrac{15 - 12}{2} = 1.5
Half its width.

Practice ★

  1. Why did Gosset publish under the name 'Student'?
    1. He worked for the Guinness brewery and published his statistics under a pen name
    2. He was still a student at university
    3. Neyman asked him to
  1. A confidence interval is (63,81)(63, 81). Find the margin of error.
  2. A confidence interval is (14,32)(14, 32). Find the margin of error.
  1. A confidence interval is (27,35)(27, 35). Find the point estimate.

Summary card

Confidence intervals today

  • Polls report a margin of error, often about 3 points.
  • Medical studies give intervals for the effect of a treatment.
  • Factories estimate defect rates from samples.

Sources: MacTutor biographies of Gosset and Neyman (see "Sources and credits").