← Back to the Introduction to Statistics outline The Course Maker
← Introduction to Statistics outline
Week 11 · Lecture

Lecture: Confidence Intervals for a Mean

Introduction to Statistics Free sample edition

Lecture script · about 15–20 minutes spoken · Week 11

Opening

A public-health team wants to report the average wait at its clinics. A coffee roaster wants to state the average weight of its bags. A field biologist wants to report the typical mass of a penguin species. All three have the same problem. They measured a sample, they got an average, and they know that average is a little off. The honest move is to report the average with a range around it, so a reader can see how much to trust it. That range is what today is about.

Here's where we are. In Weeks 1 to 3 you learned to describe one variable. Week 4 related two. Weeks 5 to 7 built probability and the binomial. Week 8 gave you the z-score, and Week 9 gave you the normal model. Last week, in Week 10, you saw that a sample mean wobbles from sample to sample, and you measured that wobble with the standard error. Today we run that idea backward. Instead of asking where sample means land around the true mean, we start from one sample mean and ask where the true mean might be. Next week, in Week 12, you'll build the same kind of range for a proportion.

We'll take nine steps in order: point estimates, interval estimates, the t distribution, the critical value, the conditions, building the interval, saying what it means, the margin of error, and what "95% confident" really means. Our examples come from a fair die and from the Adelie penguins you've known since Week 1.

1. Point estimates: one number and its wobble

A research team in Antarctica weighed Adelie penguins. Of those birds, 151 have a recorded body mass, and those 151 birds are a sample. The population is every Adelie penguin like them, and nobody can weigh all of those.

The team wants the mean mass of the whole population. We call it mu, and it's a parameter: fixed, real, and unknown. What the team actually has is x̄, read "x bar", the sample mean, which is 3,700.66 grams. A point estimate is a single number computed from a sample and used as the best guess for a population parameter. The sample mean is the point estimate of the population mean.

The single birds vary a lot. Their sample standard deviation is 458.57 grams.

Here's the catch. Last week you saw that a different sample gives a different mean. If another team weighed a different 151 Adelie birds, their average would land somewhere else. So 3,700.66 grams, reported alone, hides how far off it might be. It's like a friend telling you exactly how long a road trip will take. You know that's a guess, and you'd like to hear the "give or take".

Pause and try this. Is 3,700.66 grams a parameter or a statistic, and which symbol does it estimate?

Say it to yourself before I do.

Here's the answer. It's a statistic, the sample mean x̄. It estimates mu, the population mean, which nobody knows.

2. Interval estimates: turn the wobble into a range

How do you attach a wobble to a guess? Start somewhere you know the truth: a fair die. One roll has a mean of 3.5. Average 30 rolls, write that average down, and repeat many times. Last week you learned those averages pile up in a bell around 3.5, with a standard error of about 0.3118.

From Week 9, the middle 95% of a bell sits within 1.96 standard deviations of its center. Multiply 1.96 by the standard error and you get about 0.61. So about 95% of 30-roll averages land between 2.89 and 4.11.

Now flip it. Whenever an average lands in that band, a range of 0.61 on each side of it reaches back to 3.5. Suppose one sample averages 3.20. Its range runs from 2.59 to 3.81, and 3.5 is inside. Suppose another averages 4.20. Its range runs from 3.59 to 4.81, and 3.5 is not inside. That second sample didn't do anything wrong. It's one of the unlucky ones, and from the inside it looks like all the others.

An interval estimate is a range of plausible values for a population parameter, built as a point estimate plus or minus a margin of error. The margin of error is the distance from the point estimate to either end. And a confidence interval is an interval estimate built by a method that captures the parameter in a stated share of all possible samples, such as 95%.

Pause and try this. Is a confidence interval centered on the true mean or on the sample mean?

Think about which one you actually know.

Here's the answer. On the sample mean. You never know the true mean, so you can't center anything on it. The band around mu is the theory; the interval around x̄ is what you build.

3. The t distribution: pay for an unknown spread

The die was easy because you know sigma, the population standard deviation. You can list every face, so it's about 1.71. For the penguins, nobody knows sigma. Nobody has weighed every Adelie penguin.

So you plug in the sample standard deviation, 458.57 grams, in its place. That's reasonable, but now you're guessing twice: the mean wobbles, and so does the spread. In 1908 a statistician who signed his work "Student" worked out what that second guess costs.

The t distribution is a family of symmetric, bell-shaped curves centered at 0 with heavier tails than the standard normal distribution. It's what you use for a mean when the sample standard deviation stands in for sigma. Heavier tails means more area out at the edges. Picture the normal bell with its peak pressed down a little and the extra spread into the tails. To catch the middle 95%, you have to reach a bit farther.

Which t curve do you use? That depends on the degrees of freedom, the number that picks which t distribution to use. For one sample it's the sample size minus 1. For 151 birds, that's 150. With 150 degrees of freedom the t curve is almost the normal curve. With 9, from a sample of 10, it's noticeably flatter.

Pause and try this. Does the t distribution describe the penguin masses themselves?

Take a second with that one.

Here's the answer. No. It describes how the sample mean, measured in standard errors, varies from sample to sample when s stands in for sigma.

4. The critical value: read it off the ladder

To build a 95% interval, you need to know how many standard errors to reach. That number is the critical value: the number of standard errors a margin of error reaches for a chosen confidence level. From a normal curve it's called z-star. From a t curve it's called t-star.

You already know the normal ones from Week 9: 1.645 for 90%, 1.960 for 95%, and 2.576 for 99%. For a t curve, the critical value depends on the degrees of freedom, and the course uses a short ladder. For 95% confidence, t-star is 2.262 with 9 degrees of freedom, 2.064 with 24, and 1.976 with 150. Compare those with 1.960.

Read the ladder from top to bottom and t-star shrinks toward z-star. A sample of 10 reaches about 15% farther than a normal curve would, to pay for guessing sigma. A sample of 151 barely notices.

In a spreadsheet, the function T.INV.2T gives you t-star. You give it 0.05 for 95% confidence and the degrees of freedom, and for 150 it returns 1.976.

Pause and try this. For a sample of 25 birds, how many degrees of freedom are there, and what's t-star for 95%?

Subtract one, then read the ladder.

Here's the answer. There are 24 degrees of freedom, and t-star is 2.064. The degrees of freedom are the sample size minus 1, not the sample size.

5. Conditions: check before you compute

A formula will turn any list of numbers into an interval. Whether that interval means anything depends on where the numbers came from. So before you compute, you check three conditions out loud.

First, a random or representative sample. Second, independence: one observation shouldn't influence another. Third, shape: either the population is roughly normal, or the sample is large enough for the Central Limit Theorem. The course's rule of thumb is about 30 for a moderately skewed population, and it's a working rule, not a law.

Let's check the penguins. The birds were weighed in an observational field study, not drawn at random, so we treat them as representative of Adelie penguins in that region and say so. Each bird is weighed separately, so one mass doesn't set another. And 151 is far above 30, so the sampling distribution of the mean is approximately normal.

That first condition deserves a caveat. If the team mostly weighed birds near easy landing spots, and those birds differ from the rest, no formula can fix it.

Pause and try this. A classmate says, "With 151 birds, the sample is so big that how they were chosen doesn't matter." True or false?

Remember the trap from Week 1.

Here's the answer. False. A large sample fixes the shape condition and shrinks random wobble, but it does nothing about bias.

6. The one-sample t interval: build it

Now we put the pieces together. A one-sample t interval is the confidence interval for a population mean when sigma is unknown. It's the sample mean, plus or minus t-star times the standard error, and the standard error is s divided by the square root of n.

Let's build it for the penguins, one step at a time. The degrees of freedom are 150, so t-star is 1.976. Next, the standard error. Take 458.57 grams and divide by the square root of 151, which is about 12.29. You get about 37.32 grams. Notice that you divide by the square root of the sample size, not by the sample size itself. Now the margin of error: 1.976 times 37.32 is about 73.74 grams. Finally, step down and up from the mean. 3,700.66 minus 73.74 is 3,626.92 grams, and 3,700.66 plus 73.74 is 3,774.40 grams.

So the 95% t interval runs from 3,626.92 grams to 3,774.40 grams. It's 147.48 grams wide, twice the margin of error, because it reaches the same distance on each side.

In a spreadsheet, CONFIDENCE.T gives you that margin in one step. It keeps every digit of t-star, so its lower end can read 3,626.93 grams instead of 3,626.92. That last hundredth of a gram is rounding, not a mistake.

Pause and try this. If someone divided 458.57 by 151 instead of by its square root, would their interval come out too wide or too narrow?

Think about which number is bigger to divide by.

Here's the answer. Too narrow, by a lot. Dividing by 151 instead of about 12.29 makes the standard error about 12 times too small.

7. Interpretation: say what it means

The numbers are half the job. The other half is one sentence a reader can trust, and the course uses one template for it. Here it is for the penguins: we are 95% confident that the population mean body mass of Adelie penguins is between 3,626.92 grams and 3,774.40 grams.

Every part of that sentence works. "95% confident" names the method's track record. "Population mean" says the target is mu, not the sample's average and not single birds. The two ends and the units say where mu plausibly sits.

Now look at how narrow that window is next to the birds themselves. The interval is 147.48 grams wide. A typical bird sits about 458.57 grams from the mean. So lots of individual penguins weigh far more or far less than anything in the interval. The interval is about the mean, not about single birds.

Pause and try this. True or false: about 95% of Adelie penguins weigh between 3,626.92 and 3,774.40 grams.

Ask yourself what the interval is estimating.

Here's the answer. False. The interval estimates one number, the population mean. Single birds vary far more widely than a window 147.48 grams wide.

8. The margin of error: take it apart

The margin of error has three levers: the critical value, which comes from the confidence level; the spread, s; and the sample size, n. Move one at a time.

Start with the sample size. What if only 10 birds had been weighed, with the same spread? The degrees of freedom drop to 9, so the critical value is 2.262. The standard error becomes about 145.01 grams. Multiply, and the margin of error is about 328.01 grams. Compare that with 73.74 grams from 151 birds. That's about 4.4 times larger. With 25 birds, the margin lands in between, at about 189.29 grams. More birds help twice: the square root of n grows, so the standard error shrinks, and the degrees of freedom grow, so t-star shrinks.

Next, the confidence level. To be more confident, you need a bigger critical value: 1.645 for 90%, 1.960 for 95%, 2.576 for 99%. More confidence costs you a wider interval.

Last, the spread. The margin grows in step with s. Twice the spread, at the same sample size and confidence level, gives twice the margin.

The margin of error covers only the random wobble of sampling. It doesn't cover a biased sample or a scale that reads heavy.

Pause and try this. If you want to cut the margin of error in half, roughly how many more observations do you need: twice as many, or four times as many?

Remember what the standard error divides by.

Here's the answer. About four times as many. The standard error divides by the square root of n, and to double the square root you multiply n by 4.

9. The confidence level: what 95% does and does not mean

"95% confident" is the most misread phrase in this course, so let's pin it down. The confidence level is the long-run share of samples for which the interval method captures the population parameter. It describes the method, not the chance that one computed interval is right.

Picture many field teams, each weighing its own 151 Adelie penguins and building its own 95% interval. Every team gets a slightly different mean and spread, so every interval sits in a slightly different place. About 95% of those intervals would capture mu, and about 5% would miss it. That's about 1 team in 20, and no team can tell from its own data whether it's the unlucky one. Remember the die sample that averaged 4.20: it missed, and nothing about it looked different.

Once you've computed 3,626.92 to 3,774.40, nothing random is left. Mu is a fixed number, and the two ends are fixed numbers. Either mu is in there or it isn't. The 95% is your confidence in the method that made it.

Pause and try this. A friend says, "There's a 95% probability the true mean is in this interval." What's the fix?

Think about what's random and what isn't.

Here's the answer. The true mean doesn't move, so this interval either contains it or doesn't. The 95% belongs to the method: about 95% of intervals built this way capture the true mean.

Closing

Let's gather it up. A point estimate is one number, and it hides its wobble. An interval estimate adds a margin of error around it, and an interval built from the sample mean captures the true mean for about 95% of samples. When sigma is unknown, you use s and a t distribution with the sample size minus 1 degrees of freedom. The critical value t-star is bigger for small samples and shrinks toward z-star. You check the sample, independence, and shape before you compute. For the Adelie penguins, the 95% interval runs from 3,626.92 to 3,774.40 grams. You say it as "we are 95% confident that the population mean is between", and you remember it's about the mean, not single birds. The margin of error grows with confidence and spread and shrinks with more data. And the 95% belongs to the method, not to one interval.

Next in this module come the Readings & Resources page, the lecture tutorial, the practice set, and the quiz, then the discussion, the assignment, and the Data Lab, where you'll build this interval from the raw data yourself. Next week, in Week 12, Confidence Intervals for a Proportion, the same margin-of-error idea builds a range for a share instead of a mean.


Built with The Course Maker · samples.thecoursemaker.com