What is p-hat?
P-hat, written p̂, is the sample proportion — the fraction of a sample that has some characteristic of interest. It is calculated by dividing the number of successes (x) by the total sample size (n):
p̂ = x / n
A "success" is simply the outcome you are counting: a voter who supports a candidate, a manufactured part that passes inspection, a patient who responds to treatment. P-hat is the best single-number estimate of the unknown true population proportion p. Because it comes from a sample rather than the whole population, p̂ is subject to sampling error, which is why we also report its standard error and a confidence interval.
Worked example
Suppose you survey 200 registered voters and 42 of them support a ballot measure. Then x = 42 and n = 200, so:
- p̂ = 42 / 200 = 0.21, or 21%.
- Standard error: SE = √(0.21 × 0.79 / 200) = √0.0008295 ≈ 0.0288.
- 95% confidence interval: 0.21 ± 1.96 × 0.0288 = 0.21 ± 0.0564, i.e. about 0.154 to 0.266 (15.4% to 26.6%).
Standard error and confidence interval
The standard error measures how much p̂ would typically vary from sample to sample. For a proportion it is:
SE = √( p̂ (1 − p̂) / n )
A 95% confidence interval uses the normal approximation, p̂ ± 1.96 × SE, where 1.96 is the z-value cutting off the central 95% of a standard normal distribution. Roughly speaking, if you repeated the sampling many times, about 95% of such intervals would contain the true proportion p. Notice that SE shrinks in proportion to 1/√n — to halve the margin of error you must quadruple the sample size.
Common reference points
- The standard error is largest when p̂ = 0.5, because p̂(1 − p̂) is maximized at 0.25. Estimates near 50/50 are the hardest to pin down.
- For a 95% interval with a ±5% margin near p̂ = 0.5, you need roughly n ≈ 385 (this is why many national polls use ~1,000 respondents for a ±3% margin).
- The normal approximation is generally considered valid when both n·p̂ ≥ 10 and n·(1 − p̂) ≥ 10.