sep.sys: 2-stage population sensitivity

Description Usage Arguments Value Note Examples

View source: R/freedom_functions_1.R

Description

Calculates population-level (system) sensitivity for representative 2-stage sampling (sampling of clusters and units within clusters), assuming imperfect test sensitivity and perfect test specificity

Usage

1
sep.sys(H = NA, N = NA, n, pstar.c, pstar.u, se = 1)

Arguments

H

population size = number of clusters in the population, default = NA

N

population size within clusters, scalar or a vector of same length as n, default = NA

n

sample size (vector of number tested per cluster)

pstar.c

cluster (herd) level design prevalence, scalar, either proportion or integer

pstar.u

unit (animal) level design prevalence, scalar, either proportion or integer

se

unit sensitivity of test (proportion), scalar, default = 1

Value

list of 6 elements, 1) population level sensitivity, 2) vector of cluster-level sensitivities, 3) N, 4) n, 5) vector of design prevalences and 6) unit sensitivity

Note

if pstar.c is not a proportion N must be provided (and N>=n)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# examples for sep.sys - checked
H<- 500
N<- rep(1000, 150)
N[5]<- NA
n<- rep(30, 150)
pstar.u<- 0.1
pstar.c<- 0.01
se<- 0.98
sep.sys(H, N, n, pstar.c, pstar.u, se)
sep.sys(NA, N, n, 0.02, 0.05, 0.95)
N<- round(runif(105)*900+100)
n<- round(runif(105)*30+10)
sse<- sep.sys(1000, N, n, 0.02, 0.05, 0.9)
data.frame(N, n, sse[[2]])

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