n.hypergeo {RSurveillance}R Documentation

Hypergeometric sample size

Description

Calculates sample size for demonstrating freedom or detecting disease using hypergeometric approximation and assuming imperfect test sensitivity, perfect test specificity and representative sampling

Usage

n.hypergeo(sep, N, d, se = 1)

Arguments

sep

desired population sensitivity (scalar or vector)

N

population size (scalar or vector of same length as sep)

d

expected number of infected units in population, = design prevalence*N rounded to next integer (scalar or vector of same length as sep)

se

unit sensitivity, default = 1 (scalar or vector of same length as sep)

Value

vector of sample sizes, NA if n>N

Examples

# examples for n.hypergeo - checked
n.hypergeo(0.95, N=100, d=1, se = 0.95)
n.hypergeo(sep=0.95, N=c(100, 200, 500, 1000, 10000), d=ceiling(0.01*c(100, 200, 500, 1000, 10000)))
n.hypergeo(c(0.5, 0.8, 0.9, 0.95), N=100, d=5)
n.hypergeo(0.95, N=80, d=c(1, 2, 5, 10))
n.hypergeo(0.95, N=80, d=c(1, 2, 5, 10), se = 0.8)

[Package RSurveillance version 0.2.1 Index]