Learn R Programming

RSurveillance (version 0.2.1)

pstar.calc: Design prevalence back-calculation

Description

Calculates design prevalence required for given sample size and desired population-level sensitivity, assuming imperfect test sensitivity, perfect test specificity and representative sampling

Usage

pstar.calc(N = NA, n, sep, se)

Arguments

N

populaton size if known (scalar or vector of same length as n)

n

sample size (scalar or vector)

sep

desired population sensitivity (scalar or vector of same length as n)

se

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

Value

vector of design prevalence values

Examples

Run this code
# NOT RUN {
# examples of pstar.calc- checked
pstar.calc(NA, 280, 0.95, 0.98)
pstar.calc(500, 250, sep=0.95, se=1)
pstar.calc(N=c(100, 500, 1000, 5000, 10000, 100000, NA), n=30, sep=0.95, se=1)
pstar.calc(500, n=30, sep=0.95, se=c(0.5, 0.6, 0.7, 0.8, 0.9, 0.99, 1))
# }

Run the code above in your browser using DataLab