Cochran: Cochran's Formula

View source: R/Cochran.R

CochranR Documentation

Cochran's Formula

Description

Computes sample for proportions using Cochran's Formula

Usage

Cochran(z, p, e)

Arguments

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

Details

Used when sampling on unknown populations thus an estimated proportion is used

Value

Returns a vector which is the computed sample for the estimated proportion rounded up with ceiling function.

Note

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 |

Author(s)

Paolo G. Hilado

References

Cochran, W.G. (1963). Sampling Techniques, 2nd Ed., New York: John Wiley and Sons, Inc.

Examples

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)
  }

Dcroix/RSamplingz documentation built on April 30, 2022, 8:33 a.m.