Sample Size for a Population Proportion


The sample size to achieve a confidence interval of width 'w' for a large sample can be calculated from:
where:
the z statistic for the confidence level
w the confidence interval
s the process standard deviation
p the population proportion
The population proportion may not be known before the sample is taken, and so must be estimated.
Sample Size with Confidence Intervals 

The sample size to achieve a confidence interval of width 'w', can be calculated from:
where:
the z statistic for the confidence level
w the confidence interval
s the process standard deviation
Sample Size with Hypothesis Tests 

Based on a level of significance 'a', and a Type II error 'b' at a departure 'd' from the target mean, the formula for the ttest (small sample sizes) is:
where:
t_{a} the t statistic corresponding to the chosen level of significance (use t_{a/2} for two sided tests)
t_{b} the t statistic corresponding to the Type II error (use for both one and two sided tests)
Note that:
The formula for the z test (large sample size) is essentially the same. For large sample sizes the t statistic converges to the z statistic:
z_{a} the z statistic corresponding to the chosen level of significance (use z_{a/2} for two sided tests)
z_{b} the z statistic corresponding to the Type II error (use for both one and two sided tests)

for two sided tests use a/2, but still use b (NOT b/2)

the standard deviation must be known to use either formula, although a reasonable estimate will serve

because the tstatistic depends on the number of degrees of freedom (n1) the equation is solved iteratively. Start with the zstatistic and find an approximation for 'n' (or guess n). Use this value of 'n' to find the t statistic and recalculate to get a better approximation for 'n'. Repeat until the values converge.
