Learn R Programming

RSurveillance (version 0.2.1)

sep: Population sensitivity

Description

Calculates population sensitivity using appropriate method, depending on whether or not N provided (hypergeometric if N provided, binomial otherwise), assuming perfect test specificity and representative sampling

Usage

sep(N = NA, n, pstar, se = 1, dig = 5)

Arguments

N

population size, NA or vector of same length as n

n

sample size (number tested), scalar or vector

pstar

design prevalence as a proportion or integer, scalar or vector of same length as n

se

unit sensitivity, scalar or vector of same length as n

dig

number of digits for rounding of results

Value

a vector of population-level sensitivities

Examples

Run this code
# NOT RUN {
# examples for sep - checked
sep(n=300, pstar=0.01, se=1)
sep(NA, 300, 0.01, 1)
sep(10000, 150, 0.02, 1)
sep(n=1:100, pstar = 0.05, se=0.95)
N<- seq(30, 100, by = 5)
se<- 0.95
pstar<- 0.1
n<- rep(30, length(N))
sep(N, n, pstar, se = se)
sep(rep(100, 10), seq(10, 100, by = 10), pstar = 1, se=0.99)
N<- c(55, 134, NA, 44, 256)
n<- c(15, 30, 28, 15, 33)
sep(N, n, 0.1, 0.95)
# }

Run the code above in your browser using DataLab