n.2stage {RSurveillance} | R Documentation |
2-stage freedom sample size
Description
Calculates sample sizes for a 2-stage representative survey (sampling of clusters and units within clusters) for disease freedom or detection, assuming imperfect test sensitivity, perfect test specificity and representative sampling
Usage
n.2stage(H = NA, N = NA, sep.sys = 0.95, sep.c, pstar.c, pstar.u,
se = 1)
Arguments
H |
population size = number of clusters or NA if not known, default = NA |
N |
population sizes for clusters, default = NA, scalar or vector of population sizes for clusters |
sep.sys |
desired population sensitivity (scalar) |
sep.c |
desired cluster-level sensitivity (scalar) |
pstar.c |
specified cluster-level design prevalence as proportion or integer (scalar) |
pstar.u |
specified population-level design prevalence as proportion or integer (scalar) |
se |
unit sensitivity (scalar) |
Value
a list of 2 elements, the number of clusters to sample and a vector of sample sizes per cluster
Examples
# examples of n.2stage - checked
n.2stage(NA, NA, 0.95, 0.5, 0.01, 0.1, 0.95)
n.2stage(500, NA, 0.95, 0.5, 10, 0.1, 0.95)
n.2stage(1000, c(50, 100, 200, 500, 1000, 5000, NA), 0.95, 0.5, 0.01, 0.05, 0.8)
n.2stage(1000, c(50, 100, 200, 500, 1000, 5000, NA), 0.95, 0.5, 0.01, 1, 0.8)
n.2stage(1000, c(50, 100, 200, 500, 1000, 5000, NA), 0.9, 0.95, 1, 0.1, 0.8)