n.pfree: Sample size to achieve desired (posterior) probability of...

Description Usage Arguments Value Examples

View source: R/freedom_functions_1.R

Description

Calculates the sample size required to achieve a given value for probability of disease freedom

Usage

1
n.pfree(pfree, prior, p.intro, pstar, se, N = NA)

Arguments

pfree

desired probability of freedom (scalar or vector)

prior

prior probability of freedom before surveillance (scalar or vector of same length as pfree)

p.intro

probability of introduction for time period (scalar or vector of same length as pfree)

pstar

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

se

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

N

population size (scalar or vector of same length as pfree)

Value

a list of 3 elements, the first a vector of sample sizes and the second a corresponding vector of population sensitivity values and the third a vector of adjusted priors

Examples

1
2
3
4
5
# examples for n.pfree
n.pfree(0.95, 0.5, 0.01, 0.05, 0.9)
n.pfree(0.95, 0.5, 0.01, 0.05, 0.9, N=300)
n.pfree(pfree = c(0.9, 0.95, 0.98, 0.99), prior = 0.7, 0.01, 0.01, 0.8, 1000)
n.pfree(0.95, 0.7, 0.01, 0.1, 0.96)

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