

Confidence Intervals I
Megan Ayers
Math 141 | Spring 2026
Monday, Week 7
Homework 5 due tonight
Homework 6 is posted, but not due until 3/20 (last day before spring break)
Introduce confidence intervals as a method for estimating a parameter
Use bootstrapping as a means of creating confidence intervals
With just \(n = 9\) people, you might give a range of \(0.03\) to \(0.63\) for \(p\).
But with \(n = 48\), you might instead give the range \(0.20\) to \(0.46\).
A confidence interval estimate for a parameter usually takes the form \[ \textrm{Statistic }\pm \textrm{ Margin of Error (ME)} \]
The confidence interval gives a range of plausible values for the parameter.
\[ 0.20 \textrm{ to } 0.46 \qquad \textrm{ or } \qquad \underbrace{0.33}_{\text{Statistic ($\widehat{p}$)}} \pm \ \ \ \underbrace{0.13}_{\text{ME}} \]
The Margin of Error determines the width of the interval (\(2*\text{Margin of Error}\))
Q: How should we choose our Margin of Error? (think conceptually)
Goal: Figure out a reasonable Margin of Error
In our example, suppose \(p = 0.25\) (i.e., 25% of all party attendees prefer vegetarian)
For approximately bell-shaped sampling distributions, 95% of all sample statistics are within 2 SE of the parameter.

Idea: Build an interval centered at the sample statistic, with a margin of error of \(2\cdot SE\):
\[ \widehat{p} \pm 2\cdot \textrm{SE} \]

Idea: Build an interval centered at the sample statistic, with a margin of error of \(2\cdot SE\):
\[ \widehat{p} \pm 2\cdot \textrm{SE} \]

Idea: Build an interval centered at the sample statistic, with a margin of error of \(2\cdot SE\):
\[ \widehat{p} \pm 2\cdot \textrm{SE} \]

Idea: Build an interval centered at the sample statistic, with a margin of error of \(2\cdot SE\):
\[ \widehat{p} \pm 2\cdot \textrm{SE} \]

On the previous slide, 95% of confidence intervals contained the true parameter, \(p\).
Thus, we call each interval estimate a 95% confidence interval.
Here, 95% is our confidence level: The success rate for our estimation technique.
The confidence level corresponds to the percentage of samples that would yield a corresponding confidence interval containing the true value of the parameter.

Confidence Level: the percentage of samples that would yield a corresponding confidence interval containing the true value of the parameter.
For example, were we to:
Confidence intervals consist of 1. an interval estimate and 2. a confidence level.
In our pizza party sample, we estimated the true proportion of vegetarian pizza-eaters was between \(0.20\) and \(0.46\), with \(95\%\) confidence.
What does “95% confidence” mean?
Worth emphasizing: it’s the success rate of The Process, NOT the specific interval you calculated in your sample.
Q: What’s the difference between these two interpretations of a 95% confidence interval?
For 95% of all samples, the interval we construct will actually contain the parameter.
For a given interval, there is a 95% chance that the parameter will fall in the interval.
Q: What’s the difference between these two interpretations of a 95% confidence interval?
For 95% of all samples, the interval we construct will actually contain the parameter.
For a given interval, there is a 95% chance that the parameter will fall in the interval.
A:
The first one is accurate! 95% confidence refers to the accuracy of the process
The second one is wrong, an easy mistake to make!! It confuses probability of the process with a deterministic outcome. Our sample statistic “moves” with sampling variability - the parameter does not.
Idea: Build a 95% confidence interval centered at the sample statistic, with a margin of error of \(2\cdot SE\): \[ \widehat{p} \pm \underbrace{2\cdot \textrm{SE}}_{\text{Margin of Error}} \]
This interval’s width is determined by the Standard Error (SE).
Reminder: The SE is the standard deviation of the sampling distribution.
Q: What do we know about the SE as the sample size (\(n\)) increases?
Q: What does this imply about the interval’s width as the sample size (\(n\)) increases?
Idea: Build an 95% confidence interval centered at the sample statistic, with a margin of error of \(2\cdot SE\): \[ \widehat{p} \pm \underbrace{2\cdot \textrm{SE}}_{\text{Margin of Error}} \]
Chose \(\text{Margin of Error} = 2*SE\) because 95% of sample statistics fall within \(2*SE\) of the parameter (in sampling distribution).
Fun Fact: 90% of sample statistics fall within \(1.64*SE\) of the parameter.
Takeaway: The confidence level also determines the width of the interval!
higher confidence (e.g., 95%) means a larger margin of error (wider interval)
lower confidence (e.g., 90%) means a smaller margin of error (narrower interval)

Let’s say we’re working with 95% confidence intervals
Suppose we wish to estimate how many hours Reed students sleep, on average with a sample of 50 students, who we surveys on hours of sleep.

Create the bootstrap samples:
Q: What is each argument of rep_sample_n() doing?
Each bootstrap sample consists of 50 observations sampled with replacement from the original sample (size = 50)
We have a total of 10,000 bootstrap samples (reps = 10000)
# A tibble: 500,000 × 3
# Groups: replicate [10,000]
replicate Student Hours
<int> <int> <dbl>
1 1 28 4.40
2 1 12 6.45
3 1 7 7.71
4 1 4 7.12
5 1 9 7.12
6 1 1 7.48
7 1 27 7.26
8 1 39 6.38
9 1 37 3.74
10 1 44 7.98
# ℹ 499,990 more rows
Compute bootstrap statistics: (Mean of each bootstrap sample)
Graph the bootstrap distribution:

Our sample average sleep was \(\bar x = 7.046\).
Based on the bootstrap distribution, this statistic has Standard Error=0.165.
Our 95% confidence interval for the true average hours of sleep for Reed students is: \[ {7.046} \pm 2 \cdot \color{blue}{0.165} \]
More on changing confidence levels
What to do with distributions that aren’t bell-shaped (percentile method)
Confidence interval misconceptions