n.tp: Sample size for true prevalence

Description Usage Arguments Value Examples

View source: R/prevalence_functions.R

Description

Calculates sample size for estimating true prevalence using normal approximation

Usage

1
n.tp(p, se, sp, precision, conf = 0.95)

Arguments

p

estimated true prevalence (scalar or vector)

se

test sensitivity (scalar or vector)

sp

test specificity (scalar or vector)

precision

absolute precision, +/- proportion equal to half the width of the desired confidence interval (scalar or vector)

conf

desired level of confidence for CI, default = 0.95 (scalar or vector)

Value

a vector of sample sizes

Examples

1
2
3
4
5
# examples for n.tp
n.tp(0.1, 0.9, 0.99, 0.05)
n.tp(0.1, 0.9, 0.99, 0.05, conf = 0.99)
n.tp(c(0.05, 0.1, 0.2, 0.3, 0.4, 0.5), 0.9, 0.99, 0.05)
n.tp(0.5, 0.9, 0.99, c(0.01, 0.02, 0.05, 0.1, 0.2))

RSurveillance documentation built on July 2, 2020, 2:33 a.m.