sep.hypergeo: Hypergeometric Population sensitivity

Description Usage Arguments Value Examples

View source: R/freedom_functions_1.R

Description

Calculates population sensitivity for detecting disease, assuming imperfect test sensitivity, perfect test specificity and representative sampling, using hypergeometric approximation (assumes known population size)

Usage

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

Arguments

N

population size, scalar or vector of same length as n

n

sample size (number tested), scalar or vector

d

expected number of infected units in population (=design prevalence*N rounded to next integer)

se

unit sensitivity of test (proportion), scalar or vector of same length as n

dig

number of digits for rounding of results

Value

a vector of population-level sensitivities. if all n <= corresponding N then vector is numeric, otherwise vector is character and elements where n>N are recorded as such

Examples

1
2
3
4
5
6
7
# examples for sep.hypergeo - checked
sep.hypergeo(N=100, n=50, d=1, se = 0.92)
inf<- 1:5
sens<- 0.8
sep.hypergeo(N=100, n=50, d=inf, se=sens)
N<- c(10, 50, 100, 250, 500)
sep.hypergeo(se=0.8, N=N, n=c(5, 25, 50, 125, 250), d = ceiling(0.01*N))

Example output

[1] 0.46
[1] 0.40000 0.64000 0.78400 0.87040 0.92224
[1] 0.40000 0.40000 0.40000 0.78400 0.92224

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