Learn R Programming

RSurveillance (version 0.2.1)

n.ap: Sample size for apparent prevalence

Description

Calculates sample size for estimating apparent prevalence (simple proportion)

Usage

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

Run this code
# NOT RUN {
# 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))
# }

Run the code above in your browser using DataLab