Skip to main content

computeSampleSize_Cochran

computeSampleSize_Cochran(z, p, e) ⇒ number

Estimate ideal sample size given desired confidence level, error and population proportion with attribute in question.

Implementation of Cochran's Sample Size formula

Z values for confidence levels: 50% | 0.67449 75% | 1.15035 90% | 1.64485 95% | 1.95996 97% | 2.17009 99% | 2.57583 99.9% | 3.29053

Kind: global function
Returns: number - Sample size

ParamTypeDescription
znumberStandard distribution value. # of standard deviations. See statistical tables
pnumberFraction of the population with attribute in question. For example if we want to estimate what time people have breakfast and we know that only 30% of people have have breakfast overall, p would be 0.3
enumberError tolerance, 0.05 represents 5% error tolerance