n.freedom: Freedom sample size

Description Usage Arguments Value Examples

View source: R/freedom_functions_1.R

Description

Calculates sample size for demonstrating freedom or detecting disease using the appropriate method, depending on whether or not N provided (hypergeometric if N provided, binomial otherwise), assuming imperfect test sensitivity, perfect test specificity and representative sampling

Usage

1
n.freedom(N = NA, sep = 0.95, pstar, se = 1)

Arguments

N

population size, default = NA (unknown) (scalar or vector of same length as sep)

sep

desired population sensitivity (scalar or vector)

pstar

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

se

unit sensitivity (scalar or vector of same length as sep)

Value

vector of sample sizes, NA if N is specified and n>N

Examples

1
2
3
4
5
# examples for n.freedom - checked
n.freedom(NA, sep=0.95, pstar=0.01, se=1)
n.freedom(500, sep=0.95, pstar=0.01, se=1)
n.freedom(N=c(100, 500, 1000, 5000, 10000, 100000, NA), sep=0.95, pstar=0.01, se=1)
n.freedom(500, sep=0.95, pstar=0.01, se=c(0.5, 0.6, 0.7, 0.8, 0.9, 0.99, 1))


RSurveillance documentation built on May 19, 2017, 10:21 p.m.
Search within the RSurveillance package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.