hanegreefs.com/Statistics I
Chapter 9 of 10

Sampling distribution and confidence interval for a proportion

How sample proportions vary from sample to sample, the mean and standard deviation of p-hat, when the normal model applies, the standard error, the 95% confidence interval p-hat plus or minus 2 SE, its frequency interpretation, the margin of error and the sample size needed for a given precision.

Textbook: Ch. 10 (third edition: ch. 9) · Sessions: Module 9, lectures 11 and 12, tutorial 11 · About 70 minutes

The sampling distribution of a proportionImportant

Think of the population as a box with tickets marked "success" (a share p) and "failure". A random sample of n tickets gives a sample proportion p̂ = X/n, where X is the number of successes. Another sample gives another p̂. The distribution of p̂ over all possible samples is its sampling distribution.

Because X is binomial with mean np and SD √(np(1 − p)), dividing by n (the aX rule of chapter 6) gives:

Formula
E(p̂) = pSD(p̂) = √( p(1 − p) / n )

When the sample is large enough, p̂ is approximately normal. Check two conditions: independence (a random sample, and less than 10% of the population) and the success/failure condition (np ≥ 10 and n(1 − p) ≥ 10; with p unknown, use the observed numbers of successes and failures).

Worked example

Loyalty card holders

30% of a supermarket's customers hold a loyalty card. Samples of 500 customers are drawn.

1

Conditions

np = 150 and n(1 − p) = 350, both at least 10; 500 is a small part of all customers
2

Centre and spread

E(p̂) = 0.30; SD(p̂) = √(0.30 × 0.70/500) ≈ 0.0205
3

68-95-99.7

about 95% of samples give p̂ between 0.30 ± 2 × 0.0205, that is from 0.259 to 0.341
4

A range

P(0.28 ≤ p̂ ≤ 0.33): z from −0.98 to 1.46, about 0.764
Answer

A sample with 26% card holders would be unusual but not shocking; one with 22% would be very surprising if p really is 0.30.

The confidence interval for a proportionImportant

In practice p is unknown, so we estimate SD(p̂) with the sample proportion. This estimate is the standard error:

Formula
SE(p̂) = √( p̂(1 − p̂) / n )

Since about 95% of all p̂ values lie within 2 SDs of p, an interval of 2 SEs around p̂ will contain p for about 95% of samples. The formula sheet gives the approximate 95% confidence interval:

Formula
p̂ ± 2 × √( p̂(1 − p̂) / n )

The part after ± is the margin of error ME. Other confidence levels use another critical value z*: 1.645 for 90%, 1.96 for 95% (the exact value that the TI-84 uses in 1-PropZInt), 2.576 for 99%. A higher confidence level gives a wider interval.

Worked example

Does a majority prefer the new logo?

In a random sample of 600 customers, 318 prefer a new logo.

1

Givens

x = 318, n = 600; asked: a 95% interval for the population proportion p
2

Conditions

random sample; 318 successes and 282 failures, both at least 10
3

Estimate

p̂ = 318/600 = 0.53
4

Standard error

SE = √(0.53 × 0.47/600) ≈ 0.0204
5

Margin of error

ME = 2 × 0.0204 ≈ 0.041
6

Interval

0.53 ± 0.041, from about 0.489 to 0.571 (with 1.96: 0.490 to 0.570)
Answer

We are about 95% confident that between 48.9% and 57.1% of all customers prefer the new logo. Because 50% lies inside the interval, the data do not show that a majority prefers it.

What "95% confident" meansImportant

The frequency interpretation: if we took many random samples and built an interval from each in the same way, about 95% of those intervals would contain the true proportion p. The 95% describes the method. A single computed interval either contains p or does not; we just do not know which.

Common trapWrong: "there is a 95% probability that p lies in [0.489, 0.571]" (p is a fixed number, not random), or "95% of customers lie in the interval" (the interval is about a proportion, not about customers). Right: "we are 95% confident that p lies between 0.489 and 0.571, because 95% of intervals made this way capture p".

A sketch helps on the exam: draw a horizontal line at the true p and below it a stack of intervals from different samples; most cross the line, a few (about 1 in 20) miss it.

Margin of error and sample sizeImportant

The margin of error shrinks with the square root of n: to halve ME you need four times as many observations. Solving ME = z* √(p(1 − p)/n) for n gives the sample size needed for a chosen precision:

Formula
n = z*2 · p(1 − p) / ME2 (round up)

If you have no idea of p, use p = 0.5: p(1 − p) is then as large as possible, so the sample is large enough whatever the true p.

Worked example

Planning a poll

A polling firm wants a 95% margin of error of at most 3 percentage points; and a client asks what 4 points at 90% would need.

1

95%, z* = 2, ME = 0.03

n = 4 × 0.25/0.0009 ≈ 1,111.1, so 1,112 respondents
2

90%, z* = 1.645, ME = 0.04

n = 2.706 × 0.25/0.0016 ≈ 422.8, so 423 respondents
Answer

Always round up. The population size does not enter the formula: the same sample size works for a city or a country.

Key takeaways

  • E(p̂) = p and SD(p̂) = √(p(1 − p)/n).
  • Normal model if random, under 10% of the population, and at least 10 successes and 10 failures.
  • SE(p̂) = √(p̂(1 − p̂)/n).
  • 95% interval: p̂ ± 2 SE (TI-84: 1-PropZInt uses 1.96).
  • 95% confidence refers to the method: 95% of such intervals capture p.
  • n = z*2p(1 − p)/ME2, rounded up; p = 0.5 if unknown.

Loading cards
Question
Click, tap or press space to flip
Answer

Multiple choice (9)

Question 1 · Chapter 9

200 students are asked; 70 work while studying. SE(p̂) is about...

Why: √(0.35 × 0.65/200).
Question 2 · Chapter 9

Same data: the approximate 95% interval (z* = 2) is...

Why: 0.35 ± 2 × 0.0337.
Question 3 · Chapter 9

p = 0.54 and n = 400. SD(p̂) is about...

Why: √(0.54 × 0.46/400).
Question 4 · Chapter 9

Which change makes a confidence interval narrower?

Why: SE falls with √n.
Question 5 · Chapter 9

A 95% interval for p is [0.41, 0.47]. Which statement is correct?

Why: Frequency interpretation.
Question 6 · Chapter 9

Needed n for ME = 0.02 at 95% (z* = 2) with p unknown?

Why: 4 × 0.25/0.0004.
Question 7 · Chapter 9

A sample has 6 successes out of 80. Can you use p̂ ± 2SE?

Why: The success/failure condition fails.
Question 8 · Chapter 9

To cut the margin of error from 6 to 3 points you need...

Why: ME is proportional to 1/√n.
Question 9 · Chapter 9

A poll gives p̂ = 0.52 with ME = 0.03. Does a majority support the plan?

Why: The interval 0.49 to 0.55 includes 0.50.

Exam-style open questions (2)

Open question · Chapter 9

Full interval question

240 randomly chosen students are asked whether they have a side job; 84 say yes. (a) Give p̂. (b) Give its standard error. (c) Build a 95% interval (z* = 1.96) and check it with the TI-84. (d) Explain "95% confident" to a manager.

Show the worked outline
  • (a) p̂ = 84/240 = 0.35. Conditions: 84 and 156 are both at least 10.
  • (b) SE = √(0.35 × 0.65/240) ≈ 0.0308.
  • (c) 0.35 ± 1.96 × 0.0308 = 0.35 ± 0.060, from 0.290 to 0.410; 1-PropZInt with x = 84, n = 240 gives the same.
  • (d) If we repeated the survey many times and built an interval each time, about 95% of them would contain the true share of students with a side job.
Open question · Chapter 9

Sample size

A bank wants to estimate the share of clients who use mobile payments within 2.5 percentage points with 95% confidence (z* = 2). Last year the share was about 70%. How many clients should it sample, and how many without that prior knowledge?

Show the worked outline
  • With p = 0.7: n = 4 × 0.21/0.000625 = 1,344.
  • With p = 0.5: n = 4 × 0.25/0.000625 = 1,600.
  • The prior guess saves 256 interviews, but only if the share is still near 70%.

LabSampling distribution lab

Compare n = 25, 500 and 2000 to see the spread shrink.

LabConfidence interval for a proportion

The default numbers are the logo example.

LabSample size planner

Always rounded up.