p ± z · √(p(1 − p) / n)
Holds when the sample is drawn at random, the observations are independent, and n · p(1 − p) is not too
small — a common rule of thumb is at least 10.
p is the known proportion in the population, n the sample size and z the critical value: 1.96 for 95%
and 2.576 for 99%. The interval says where the proportion p̂ of a sample yet to be drawn lands with that
probability. The same interval is often described as the middle 95% of the sampling distribution of p̂.
60% of a town’s voters voted yes in a referendum. You ask 600 of them, at random:
√(0.6 · 0.4 / 600) = √0.0004 = 0.02, and 0.6 ± 1.96 · 0.02 = 0.6 ± 0.0392. With probability 95%, the
sample’s proportion lands between 56.1% and 63.9%.
The interval is centred on p, not on the sample
Say your sample comes back with 52% yes. The question is whether that is consistent with 60% having voted
yes.
|
Interval |
Conclusion |
| Wrong |
52% ± 4.0 points |
an interval around the sample, which answers a different question |
| Right |
60% ± 3.9 points, 56.1–63.9% |
52% lies outside it |
A prediction interval is worked out before the sample is drawn, from the known proportion. 52% falling
outside it means such a result is unusual if the proportion really is 60% — either the sample was an
unusual one, or the proportion has moved since the vote. That line of reasoning is the basis of a
hypothesis test.
A smaller sample
The same 60%, but only 100 people asked: √(0.6 · 0.4 / 100) ≈ 0.049, and the interval is 0.6 ± 0.096, so
50.4–69.6%. Now 52% sits inside the interval, and the same result settles nothing. Fewer observations give
a wider interval, and it takes a larger departure for anything to stand out.
| n |
Interval at p = 0.6 (95%) |
| 100 |
50.4–69.6% |
| 600 |
56.1–63.9% |
| 2,400 |
58.0–62.0% |
Four times the sample halves the width, because n sits under the root.
If what you have is the sample, and the population’s proportion is what you want to estimate, that is a
confidence interval for a proportion:
the same arithmetic with the sample’s p̂ under the root.
Common mistakes
- The wrong proportion under the root. In a prediction interval it is the known proportion p, not the
sample’s.
- n outside the root. √(p(1 − p)) / n gives an interval √n times too narrow.
- A count instead of a proportion. The interval is for the proportion; for the number of yes answers,
multiply the limits by n: 600 · 0.561 ≈ 337 to 600 · 0.639 ≈ 383.
- Expecting every sample inside. About 5 in 100 samples land outside a 95% prediction interval even
when p is right.
Questions people ask
What is the difference between a prediction interval and a confidence interval?
What is known. A prediction interval starts from the population’s proportion and says something about the
sample; a confidence interval starts from the sample and says something about the population. The
formulas look alike, with p or p̂ under the root.
Why is 95% a probability here but not for a confidence interval?
Here the sample has not been drawn yet, so its proportion is a random variable and can have a
probability of landing in the interval. In a confidence interval the population’s proportion is a fixed
number, and the probability is about the method.
Where does the root come from?
The number of yes answers in the sample is binomially distributed with variance n · p(1 − p). The
proportion is that number divided by n, so its variance is p(1 − p)/n and its standard deviation the root
of that. See the variance of the binomial distribution.