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

Lecture: Confidence Intervals for a Proportion

Introduction to Statistics Free sample edition

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

Opening

A public-health office reports the share of residents who are vaccinated. A campus survey reports the share of students who ride the shuttle. A news poll reports the share of voters who back a new bus line. Every one of those is a share, and every one comes from a sample, not from asking everyone. The honest version of each share comes with a plus-or-minus. Today is about where that plus-or-minus comes from, and about what it quietly leaves out.

Here's where we are. Weeks 1 to 3 described one variable, and Week 4 related two. Weeks 5 to 7 built probability, Week 8 added the z-score, and Week 9 gave you the normal model. In Week 10 you saw that a sample proportion wobbles around the true proportion in a predictable way. Last week, in Week 11, you built your first confidence interval, for a mean. Today you build the same kind of interval for a share. Next week, in Week 13, the course turns from estimating to testing a claim.

We'll take eight steps in order. We'll reuse last week's recipe, find the standard error of a share, and check the conditions. Then we'll build the interval, say what it means, and read a poll's margin of error. We'll finish by choosing a sample size and naming what the margin of error doesn't cover. Our examples come from the Palmer penguins, from news polls, and from one quick roll of a die.

1. From a mean to a proportion: reuse the interval recipe

Last week you built an interval in three moves. You started with an estimate from a sample. You figured out how much that estimate wobbles, its standard error. And you reached out a set number of standard errors on each side, the critical value. Estimate, plus or minus critical value times standard error.

Here's the thing I want you to notice. Nothing in that recipe cares whether the estimate is a mean. It works for any statistic whose wobble you understand. And in Week 10 you met a second statistic like that: the sample proportion, p̂, read "p hat", the share of a sample with some trait.

Think of a recipe card for a sauce. Swap the tomatoes for peppers and the steps stay the same; only one ingredient changes. That's what happens this week. The steps stay. The estimate changes from a sample mean to a sample share.

Here's our question for the whole lecture. Researchers in the Palmer penguin study recorded the sex of 333 penguins. What share of penguins like those are female? That unknown share in the whole population is p, the population proportion. The 333 penguins with a recorded sex are a sample, and the share of females among them is a statistic.

Pause and try this. In the penguin question, which number is the parameter: the share of females among the 333 birds, or the share among all penguins like them?

Picture which one you could actually count.

Here's the answer. The share among all penguins like them is the parameter, p. The share among the 333 birds is the statistic, p̂, which you can count and use as the estimate.

2. The standard error of p̂: plug in what you know

In Week 10 you learned how much a sample share wobbles: take p times one minus p, divide by the sample size, and take the square root. There's a catch. That formula needs p, the very number you're trying to find.

Last week had the same problem with the population standard deviation, and the fix was to plug in the sample's own value. Same fix here. Wherever the formula wants p, you put in p̂.

The standard error of the sample proportion is the estimated standard deviation of p̂ from sample to sample. It uses the sample proportion in place of the unknown population proportion.

Let's do it with the penguins. Of the 333 birds, 165 are female and 168 are male. Divide 165 by 333 and you get about 0.4955. The share of males is 0.5045. Multiply those two shares and you get about 0.25. Divide by 333 and take the square root, and you land on a standard error of about 0.0274. That's close to 3 percentage points. A share computed from 333 birds typically wobbles by about that much from one sample to the next.

One more change from last week: no t distribution. For a mean, the sample standard deviation was a separate, extra guess, and the t distribution paid for it. For a share, the spread comes straight from p̂, so there's no extra guess. You use the normal critical value, z-star: 1.645 for 90%, 1.960 for 95%, and 2.576 for 99%.

Pause and try this. The standard error came out to about 0.0274. Is that the spread of single penguins, or the wobble of the sample share?

Say the difference out loud.

Here's the answer. It's the wobble of the sample share from one sample of 333 birds to the next. A single penguin is either female or male; the standard error describes the share.

3. Conditions: check the counts before you compute

Before you trust a normal model for p̂, check three things out loud.

First, a random sample, or one you can defend as representative. Second, independence: one individual's answer shouldn't set another's. Third, large counts: at least 10 successes and at least 10 failures in the sample. That's Week 7's large-counts rule of thumb, now applied to the counts you actually observed.

The penguins were studied in a field study, not drawn at random, so you treat them as representative of penguins in that region and say so. Each bird's sex is recorded separately. And the sample has 165 females and 168 males, both far above 10. So the conditions hold, with one honest caveat about how the birds were chosen.

Now a check that fails. Suppose you roll a die 12 times and get 2 sixes. That's 2 successes and 10 failures. Two is below 10, so this interval isn't appropriate for the share of sixes. With so few sixes, a bell curve would badly misdescribe how that share behaves.

One more honest note. Some courses use 5 instead of 10 in this rule. It's a working rule of thumb, not a law of nature, and this course uses 10.

Pause and try this. Which count sinks the dice example: the successes or the failures?

Count each one before you answer.

Here's the answer. The successes. There are only 2 sixes, below 10, even though the 10 failures squeak by.

4. The one-proportion z interval: build it by hand and by spreadsheet

Now put the pieces together. The one-proportion z interval is the confidence interval for a population proportion: p̂ plus or minus z-star times the square root of p̂ times one minus p̂, over n. It's used after checking for a random or representative sample, independent observations, and at least 10 successes and 10 failures.

Read it from the inside out. The square root is the standard error. Z-star times the standard error is the margin of error. The estimate plus or minus that margin gives you the two ends.

For the penguins at 95%, z-star is 1.96. Multiply 1.96 by the standard error, 0.0274, and you get about 0.0537. That's about 5.4 percentage points. Step 0.0537 down from 0.4955 and the same amount up. The interval runs from 0.4418 to 0.5492, or about 44.2% to 54.9%. Its width is two margins, about 10.8 percentage points.

In a spreadsheet, a COUNTIF on the sex column gives you 165 females and 168 males. The function NORM.S.INV with 0.975 gives you 1.96. The spreadsheet keeps every digit, and its two ends still round to 0.4418 and 0.5492.

Pause and try this. If someone writes the interval as 49.55 plus or minus 0.0537, what went wrong?

Look at the units on each side.

Here's the answer. They mixed scales. On the proportion scale it's 0.4955 plus or minus 0.0537; on the percentage scale it's 49.55% plus or minus 5.37 points.

5. Interpretation: say what the interval means

The numbers are half the job. The other half is one sentence a reader can trust, and last week's template carries over with one word changed.

Here it is for the penguins. We are 95% confident that the population proportion of female penguins, among penguins like those studied, is between 0.4418 and 0.5492.

Every part of that sentence works. "95% confident" names the method's track record: about 95% of intervals built this way capture the true share. "Population proportion" says the target is p, not p̂. And the two ends say where p plausibly sits.

An interval also sorts claims. The value 0.5, an even split, sits inside, so the data are consistent with an even split between females and males. A claim that only 40% are female, or that 60% are, sits outside, so it fits the data poorly. But "consistent with" isn't "proves". The interval also holds values like 0.46 and 0.54.

Pause and try this. Someone says there's a 95% chance that p is between 0.4418 and 0.5492. What's off?

Think about whether p moves.

Here's the answer. The share p is fixed, so this one interval either contains it or doesn't. The 95% describes the method across many samples, not this one interval.

6. Read a poll's margin of error

Now the place you'll meet this most often: a news poll. When a pollster plans a poll, there's no p̂ yet. So they plan with the conservative p̂, the planning value of 0.5. Half times half is 0.25, the largest that product can be, so it gives the widest margin. A margin planned that way is never too small.

With that choice, the 95% margin depends only on the sample size. For 100 people it's 0.098, about 9.8 points. For 400 it's 0.049, about 4.9 points. For 1,000 it's 0.031, about 3.1. For 1,500, about 2.5, and for 2,500, about 2.0.

Look at the first two. 400 is four times 100, and the margin is cut in half, from 9.8 to 4.9. Quadruple the sample, halve the margin, because of the square root. Going from 100 to 2,500 is 25 times the people, and the margin drops to one-fifth. That's why precision gets expensive fast.

Margins are reported in percentage points, hundredths on the proportion scale. A poll at 52%, plus or minus 3 points, runs from 49% to 55%. It isn't 3% of 52%.

The confidence level is a lever too. For the penguins, a 90% margin is about 4.5 points and a 99% margin is about 7.1 points. More confidence costs a wider interval.

Pause and try this. A pollster wants to cut a 4.9-point margin to about 2.5 points. Using the ladder, roughly how many people would that take, starting from 400?

Use the rule about four times the people.

Here's the answer. Roughly 1,500 people. Halving the margin takes about four times the people, and the ladder shows 1,500 people gets you to about 2.5 points.

7. Choose a sample size before you collect data

A study is cheapest to fix before it starts. If you know the margin you need, you can turn the formula around and solve for the sample size. The sample-size formula for a proportion gives how many individuals a study needs for a target margin of error at a chosen confidence level, and the result is always rounded up.

Say a student government wants the share of students who use the shuttle, within 3 points at 95%. With no earlier estimate, use the conservative 0.25 for p̂ times one minus p̂. Divide 1.96 by 0.03, square it, and multiply by 0.25. You get 1,067.1. You round up to 1,068 people. Why up? Rounding down to 1,067 would leave the margin a hair above 3 points, and you'd miss your target.

Now loosen it to 5 points. The same steps give 384.16, which rounds up to 385 people. So 1,068 interviews versus 385 is about a 2.8-fold difference in cost. A survey team can decide which trade it wants: more precision, or a cheaper study.

Pause and try this. Why do you round 384.16 up to 385 instead of down to 384?

Think about which way misses the target.

Here's the answer. With 384 people the margin would land a hair above 5 points. Rounding up is the only way to guarantee the margin you planned for.

8. What the margin of error does not cover

Here's the most important caution of the week. The margin of error measures sampling variability only. It describes how much p̂ wobbles because you got this random sample and not another. It says nothing about whether the sample was drawn fairly or the question was asked fairly.

So a lot sits outside it. Voluntary-response and convenience samples, from Week 1, sit outside it. So does undercoverage, when some groups have little or no chance of being included. So does non-response bias, when many people chosen can't be reached or won't answer, and those who respond differ from those who don't. And so does question-wording bias, when the wording pushes people toward an answer.

Here's a story to hold it. A news site posts an online poll, and 10,000 readers click an answer. Do the arithmetic and the margin is a little under 1 percentage point. That sounds impressive. But only readers who cared enough to click took part. A careful random poll of 1,000 people, with a margin of about 3 points, can beat it. No number of clicks removes the bias. Week 1 said it first: a bigger sample doesn't fix a biased method.

Wording works the same way. "A small fee to keep the shuttle running" and "a new tax on students" can describe one plan and draw very different shares. Both polls might report the same margin, and the margin wouldn't say a word about the gap between them.

Pause and try this. A poll reports plus or minus 3 points but drew its sample only from people who answered a pop-up ad. Does the 3 points cover that problem?

Ask what the margin measures.

Here's the answer. No. The margin covers only random sampling wobble. Who chose to answer is bias, and it sits outside the plus-or-minus.

Closing

Let's gather it up. An interval for a share uses last week's recipe: estimate, plus or minus critical value times standard error. The standard error of a share is the square root of p̂ times one minus p̂, over n. Check for a representative sample, independence, and at least 10 successes and 10 failures before you compute. For the penguins, the 95% interval runs from 0.4418 to 0.5492, and it's consistent with an even split. Read it as "we are 95% confident that the population proportion is between", never as a chance for one interval. Polls plan with a share of 0.5, report margins in percentage points, and halve the margin by quadrupling the sample. Size a study by solving for n and rounding up, like 1,068 for 3 points. And remember that the margin of error measures wobble, not bias.

Next in this module come the slide deck, the Readings and Resources page, the lecture tutorial, the practice set, and the quiz. Next week, in Hypothesis Testing: Foundations, you turn a question like "is the split even?" into a formal test.


Built with The Course Maker · samples.thecoursemaker.com