Course contentsShow
← Data Science
Lesson 293 of 2,1458. Confidence IntervalsFree lesson

Sample Size for Estimating a Proportion

Determine sample size for proportion estimates using conservative and pilot estimate approaches.

Sample Size for Estimating a Proportion

You'll learn how to calculate the minimum sample size needed to estimate a population proportion with a desired level of precision.

The Core Idea

When planning a survey or study to estimate a proportion (like approval rating or conversion rate), you need enough data to achieve your desired margin of error. Too few samples and your confidence interval will be uncomfortably wide; too many wastes resources. The sample size formula lets you work backward from your precision goal.

The Formula

The sample size needed is:

n = (Z² × p × (1-p)) / E²

Where:

  • Z = critical value for your confidence level (1.96 for 95%)
  • p = estimated proportion
  • E = desired margin of error

Two Approaches for p

Conservative Approach

When you have no prior information, use p = 0.5. This gives the largest possible sample size because variance is maximized when p = 0.5. It's like planning for the worst-case scenario—you'll have enough samples no matter what the true proportion is.

Pilot Estimate Approach

If you have a reasonable guess from past studies or a small pilot sample, use that value for p. For example, if historical data suggests 30% conversion rate, use p = 0.3. This typically requires fewer samples but relies on your estimate being reasonably accurate.

Example Logic

Say you want ±3% margin of error at 95% confidence. Using the conservative approach (p = 0.5):

n = (1.96² × 0.5 × 0.5) / 0.03² ≈ 1,068 samples

Key Takeaway: To determine sample size for proportion estimates, use p = 0.5 for maximum safety when planning, or use a pilot estimate if you have prior knowledge—both plug into the same formula with your desired margin of error and confidence level.