How to find a confidence interval for a population proportion

If we want to know what fraction of a population has a certain trait, it usually makes sense to start with a sample. The sample gives us an estimate, and a confidence interval tells us how much room to leave on either side. Let’s work through that calculation with a sample of sea turtles.

Find the sample proportion and standard error

Let p be the population proportion. If x out of n observations have the trait we’re looking for, then the sample proportion is pˆ=x/n. For independent observations, the sampling standard deviation of pˆ uses the unknown p. We estimate it by substituting pˆ, which gives the estimated standard error.

σpˆ=p(1-p)nSE=pˆ(1-pˆ)n

The one-proportion z interval is the sample proportion plus or minus a margin of error. The critical value z* depends on the confidence level.

pˆ±z*pˆ(1-pˆ)n

Use a random sample and check that it has at least 10 successes and 10 failures for the normal approximation. When sampling without replacement, the usual independence approximation uses n at most 10% of the population size N. For a simple random sample without replacement, we can account for the finite population by multiplying the standard error by

N-nN-1

Find a 90% confidence interval

A bay off Maui has 500 sea turtles. In a random sample of 50 turtles, 20 are male. We have 20 successes and 30 failures, so the counts are large enough. The sample is 10% of the population, so we can use the usual approximation. Our sample proportion is pˆ=20/50=0.40.

A 90% interval leaves 5% in each tail of the standard normal distribution. The positive critical value has 95% of the area to its left, so z*≈1.645.

The middle 90 percent of the standard normal curveThe middle area between minus 1.645 and 1.645 is 90 percent. The two tails have 5 percent each.−1.64501.64590%5%5%
The upper cutoff leaves 5% to its right, so its cumulative probability is 95%.
0.40±1.6450.40(0.60)50≈0.40±0.1140≈(0.2860,0.5140)

If we apply the finite population correction for the 500 turtles, the multiplier is 450/499, and the interval is approximately (0.2918,0.5082). For either method, the confidence level describes how often intervals made the same way would contain the true proportion over many repeated samples.

Choose a sample size for a target margin of error

Let E be the largest margin of error we want, and let p0 be a planning estimate for the proportion. For independent sampling or a large population, solve the margin of error inequality for n.

z*p0(1-p0)n≤En≥(z*)2p0(1-p0)E2

If we don’t have a planning estimate, use p0=0.50. That makes p0(1-p0) as large as possible, so the resulting sample size covers the largest margin of error for this formula. Round the required sample size up.

At 90% confidence with E=0.04, the bound is

(1.645)2(0.25)/(0.04)2≈422.82

The large-population calculation therefore gives 423. For sampling without replacement from the 500 turtles, we can include the correction in the planning calculation. If n0 is the unrounded large-population result, the adjusted requirement is

n≥Nn0N-1+n0

For the 500 turtles, this gives n≥229.34 approximately, so 230 turtles meet the target with the correction. For a separate large-population example at 99% confidence, using z*≈2.576 and the same E=0.04 gives a bound of 1,036.84, so we need 1,037 observations.