Cochran | R Documentation |
Computes sample for proportions using Cochran's Formula
Cochran(z, p, e)
z |
abscissa of the normal curve that cuts off an area alpha at the tails |
p |
estimated proportion of the population which has the attribute in question |
e |
margin of error for estimated proportion |
Used when sampling on unknown populations thus an estimated proportion is used
Returns a vector which is the computed sample for the estimated proportion rounded up with ceiling function.
Commonly used z-scores: r = 0.90; z-score = 1.645 | r = 0.95; z-score = 1.96 | r = 0.98; z-score = 2.326 | r = 0.99; z-score = 2.576 |
Paolo G. Hilado
Cochran, W.G. (1963). Sampling Techniques, 2nd Ed., New York: John Wiley and Sons, Inc.
Cochran(1.96, 0.75, 0.05) [1] 289 ## The function is currently defined as function (z, p, e) { q <- 1 - p x <- z * z y <- x * p * q res <- y/(e * e) res <- ceiling(res) print(res) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.