Planning a Sample Size for a Proportion
When a study is being designed, the sample size must be chosen before the final sample proportion is known. The design question is therefore not “What is the interval from these data?” but “How many independent observations should be collected so that the interval is expected to have a suitably small margin of error?” For a binomial proportion, the answer depends on the confidence level, the desired precision, and a planning value for the proportion.
The central planning issue is that the variability of a sample proportion depends on the unknown population proportion. A reasonable prior estimate can reduce the required sample size. If no defensible estimate is available, a conservative choice gives a sample size that is sufficient across all possible proportions under the usual Wald planning formula.
The Sample-Size Formula
For design, replace the not-yet-observed \(\hat p\) in the Wald margin of error by a planning value \(p_0\). Setting that planned margin equal to the target \(E\) and solving for \(n\) gives the required sample size. Since a sample size must be an integer and rounding down could miss the target, round the result up.
Here \(E\) is expressed as a proportion, not as a percentage number: a target of 3 percentage points means \(E=0.03\). The planning value \(p_0\) is a proposed value of the population proportion \(p\), based on prior evidence or a conservative convention. It is not a value substituted for the unknown proportion in the final analysis.
The formula is based on the approximate Wald interval, a binomial model, and a normal approximation for the sample proportion. It assumes independent observations with a common probability of success and does not include a finite-population correction. If sampling is without replacement from a finite population, or if the analysis will use a different interval procedure, this formula may not deliver the intended precision; the design calculation must then match that sampling or interval method.
Why the Formula Works
A binomial count is the sum of \(n\) independent Bernoulli indicators. Each indicator has mean \(p\) and variance \(p(1-p)\), so the sample proportion has variance \(p(1-p)/n\). Its estimated standard error replaces \(p\) with the observed \(\hat p\). The Wald interval’s half-width is its critical value times that estimated standard error.
To make this planned half-width no greater than \(E\), require \(z_{1-\alpha/2}\sqrt{p_0(1-p_0)/n}\leq E\). Both sides are nonnegative, so squaring and rearranging yields \(n\geq z_{1-\alpha/2}^{\,2}p_0(1-p_0)/E^2\). The ceiling gives the smallest integer sample size meeting this inequality under the planning calculation.
Choosing a Planning Proportion and Checking the Design
If reliable pilot information or prior data suggest a value \(p_0\), using it can produce a smaller sample size than the conservative choice. The estimate should be relevant to the population and outcome being studied. If it is too optimistic, the actual proportion may have greater variability than assumed, and the achieved interval may be wider than planned.
A normal-approximation check is also important. A common planning rule is to check whether both \(np_0\) and \(n(1-p_0)\) are at least 10. This is a useful diagnostic, not a universal guarantee of good coverage. After data collection, the observed counts \(n\hat p\) and \(n(1-\hat p)\) can also be examined. In particular, a small observed count or a proportion near 0 or 1 can make a Wald interval unreliable, even when the design calculation looked adequate.
The formula plans a margin of error using \(p_0\); it does not guarantee that every realized Wald interval has margin at most \(E\). The realized half-width depends on \(\hat p\), which varies from sample to sample. Likewise, the formula is a normal-approximation planning tool, not an exact finite-sample guarantee. If a study requires a specific alternative interval, such as a Wilson interval, its width should be assessed using that interval rather than assumed to match this Wald calculation.
Worked Example: Planning With Prior Proportion Information
A hypothetical insurer plans an independent survey of policyholders to estimate the proportion who choose paperless notices. A prior internal pilot suggests \(p_0=0.30\). The design calls for a 95% Wald confidence interval with margin of error at most 0.04. Find the required sample size and check the planned precision.
Method. Use the Wald sample-size formula with \(z_{0.975}=1.96\), \(p_0=0.30\), and \(E=0.04\). The target is already expressed as a proportion.
First calculate \(p_0(1-p_0)=0.30(0.70)=0.21\), and \(1.96^2=3.8416\). Thus,
The sample size must be rounded up, so \(n_{\min}=505\). Check the planned margin: \(1.96\sqrt{0.21/505}\approx1.96(0.02039)\approx0.0400\). The value \(n=504\) is below the unrounded requirement and gives a planned margin slightly greater than 0.04.
Check. The expected success and failure counts under the plan are \(505(0.30)=151.5\) and \(505(0.70)=353.5\), both comfortably above 10. The common mistake avoided here is rounding 504.21 to 504; sample-size requirements must be rounded up, not to the nearest integer.
Worked Example: No Planning Value Is Available
A hypothetical public-health team wants a 99% confidence interval for the proportion of residents who use a new appointment-booking service. There is no relevant pilot estimate, and the target margin of error is 0.03. Find a conservative sample size using the Wald planning formula.
Method. With no defensible prior value, use \(p_0=0.50\), which maximizes \(p_0(1-p_0)\). For a 99% two-sided interval, use \(z_{0.995}=2.576\). Convert 3 percentage points to \(E=0.03\).
Rounding up gives \(n_{\min}=1844\). The planned margin at that sample size is \(2.576\sqrt{0.25/1844}\approx0.0300\). At \(n=1843\), the planned margin is just above 0.03, so rounding down would not meet the specified target.
Check. At the conservative planning value, the expected success and failure counts are each \(1844(0.50)=922\). The calculation avoids the mistake of using a guessed proportion without justification: choosing \(0.50\) protects the planned variance when no reliable estimate exists. It is conservative for the Wald variance calculation, but it does not guarantee the realized interval width or exact coverage.
Worked Example: Using a Pilot Estimate Near Zero
A hypothetical research group will estimate the proportion of submitted equipment claims that require a particular follow-up review. A small pilot suggests \(p_0=0.12\). The group wants a 90% Wald confidence interval with margin of error at most 0.025. Find the sample size and check the expected counts.
Method. Use \(z_{0.95}=1.645\), \(p_0(1-p_0)=0.12(0.88)=0.1056\), and \(E=0.025\), so \(E^2=0.000625\).
The minimum whole-number sample size is \(n_{\min}=458\). Its planned margin is \(1.645\sqrt{0.1056/458}\approx1.645(0.01518)\approx0.0250\), while using 457 observations would fall short of the calculated threshold.
Check. The expected success count is \(458(0.12)=54.96\), and the expected failure count is \(458(0.88)=403.04\); both exceed 10. The common mistake avoided is treating a small pilot proportion as a reason to omit the failure probability: the variance factor is \(p_0(1-p_0)\), not \(p_0\) alone.
Common Exam Traps
- Using the percentage number rather than the proportion. Substitute \(E=0.03\), not \(3\), for a three-percentage-point target. Squaring 3 instead of 0.03 changes the result drastically.
- Using the wrong critical value. A two-sided confidence level uses \(z_{1-\alpha/2}\); for 95%, this is \(z_{0.975}=1.96\), not \(z_{0.95}\).
- Ignoring the planning value. The sample-size formula contains \(p_0(1-p_0)\). When no reliable value is available, \(0.50\) is the conservative choice.
- Rounding down or to the nearest integer. Always take the ceiling of the calculated requirement, then check the margin at that integer.
- Calling planned precision a guarantee. The final Wald margin uses \(\hat p\), not \(p_0\). The design calculation targets a margin under its planning assumption; realized precision can differ.
Check Your Understanding
For each design, use the two-sided Wald planning formula, select the stated or conservative planning value, and round the required sample size up.
- A 95% confidence interval is required with margin of error 0.05 and no prior estimate of the proportion. What conservative sample size is needed? (Answer: 385)
- A pilot suggests a proportion of 0.25. Find the sample size for a 90% confidence interval with margin of error 0.04, using \(z_{0.95}=1.645\). (Answer: 318)
- No planning estimate is available. Find the sample size for a 99% confidence interval with margin of error 0.02, using \(z_{0.995}=2.576\). (Answer: 4148)
- A planning estimate is \(p_0=0.60\). Find the sample size for a 95% confidence interval with margin of error 0.03, using \(z_{0.975}=1.96\). (Answer: 1025)
- A pilot suggests \(p_0=0.20\). Find the sample size for a 95% confidence interval with margin of error 0.025, using \(z_{0.975}=1.96\). (Answer: 984)