rsampcalc: Determines random sample size

Description Usage Arguments Value References Examples

View source: R/rsampcalc.R

Description

Determines random sample size

Usage

1
rsampcalc(N, e, ci = 95, p = 0.5, over = 0)

Arguments

N

population universe (e.g. 10000, nrow(df))

e

tolerable margin of error (integer or float, e.g. 5, 2.5)

ci

(optional) confidence level for establishing a confidence interval using z-score (defaults to 95; restricted to 80, 85, 90, 95 or 99 as input)

p

(optional) anticipated response distribution (defaults to 0.5; takes value between 0 and 1 as input)

over

(optional) desired oversampling proportion (defaults to 0; takes value between 0 and 1 as input)

Value

Returns appropriate sample size (rounded up to nearest integer)

References

[1] Sampling Design & Analysis, S. Lohr, 1999, equation 2.17

Examples

1
2
3
rsampcalc(N=5361, e=3, ci=95, p=0.5, over=0.1)

rsampcalc(nrow(data), 3)

sampler documentation built on Sept. 15, 2019, 5:02 p.m.