Sample size for apparent prevalence

Share:

Description

Calculates sample size for estimating apparent prevalence (simple proportion)

Usage

1
n.ap(p, precision, conf = 0.95)

Arguments

p

expected proportion, scalar or vector of values

precision

absolute precision, +/- proportion equivalent to half the width of the desired confidence interval, scalar or vector of values, note: at least one of p and precision must be a scalar

conf

level of confidence required, default = 0.95 (scalar)

Value

a vector of sample sizes

Examples

1
2
3
4
5
# examples of n.ap
n.ap(0.5, 0.1)
n.ap(0.5, 0.1, conf=0.99)
n.ap(seq(0.1, 0.5, by = 0.1), 0.05)
n.ap(0.2, c(0.01, 0.02, 0.05, 0.1))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.