n.pooled: Sample size for pooled testing for freedom

Description Usage Arguments Value Examples

View source: R/freedom_functions_1.R

Description

Calculates sample size to achieve desired population-level sensitivity, assuming pooled sampling and allowing for imperfect sensitivity and specificity of the pooled test

Usage

1
n.pooled(sep, k, pstar, pse, psp = 1)

Arguments

sep

desired population sensitivity (scalar or vector)

k

pool size (constant across pools) (scalar or vector of same length as sep)

pstar

design prevalence (scalar or vector of same length as sep)

pse

pool-level sensitivity (scalar or vector of same length as sep)

psp

pool-level specificity (scalar or vector of same length as sep)

Value

vector of sample sizes

Examples

1
2
3
4
# examples for n.pooled
n.pooled(0.95, 5, 0.01, 1, 1)
n.pooled(0.95, 10, 0.1, 0.9, 1)
n.pooled(0.95, c(2, 5, 10, 20), 0.1, c(0.99, 0.98, 0.97, 0.95), 1)

Example output

[1] 60
[1] 4
[1] 15  6  3  2

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