sep: Population sensitivity

Description Usage Arguments Value Examples

View source: R/freedom_functions_1.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 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)

Example output

[1] 0.95096
[1] 0.95096
[1] 0.95133
  [1] 0.04750 0.09274 0.13584 0.17689 0.21598 0.25322 0.28870 0.32248 0.35467
 [10] 0.38532 0.41452 0.44233 0.46882 0.49405 0.51808 0.54097 0.56278 0.58354
 [19] 0.60333 0.62217 0.64011 0.65721 0.67349 0.68900 0.70377 0.71784 0.73125
 [28] 0.74401 0.75617 0.76775 0.77879 0.78929 0.79930 0.80883 0.81791 0.82656
 [37] 0.83480 0.84265 0.85012 0.85724 0.86402 0.87048 0.87663 0.88249 0.88808
 [46] 0.89339 0.89846 0.90328 0.90787 0.91225 0.91642 0.92039 0.92417 0.92777
 [55] 0.93120 0.93447 0.93758 0.94055 0.94337 0.94606 0.94862 0.95106 0.95339
 [64] 0.95560 0.95771 0.95972 0.96163 0.96346 0.96519 0.96685 0.96842 0.96992
 [73] 0.97135 0.97271 0.97401 0.97524 0.97642 0.97754 0.97860 0.97962 0.98059
 [82] 0.98151 0.98239 0.98323 0.98402 0.98478 0.98550 0.98619 0.98685 0.98747
 [91] 0.98807 0.98863 0.98917 0.98969 0.99018 0.99065 0.99109 0.99151 0.99192
[100] 0.99230
 [1] 0.99988 0.99881 0.99317 0.99337 0.98530 0.98749 0.97906 0.98239 0.97426
[10] 0.97817 0.97051 0.97467 0.96751 0.97175 0.96508
 [1] 0.099 0.198 0.297 0.396 0.495 0.594 0.693 0.792 0.891 0.990
[1] 0.83458 0.96484 0.93888 0.85869 0.96651

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