Learn R Programming

RSurveillance (version 0.2.1)

pfree.calc: Probability of freedom over time

Description

Calculates the probability (confidence) of disease freedom for given prior, sep and p.intro over 1 or more time periods

Usage

pfree.calc(sep, p.intro, prior = 0.5, discount.1 = TRUE)

Arguments

sep

population sensitivity for each time period (vector)

p.intro

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

prior

prior probability of freedom before surveillance (scalar)

discount.1

logical variable whether or not to discount first time period.

Value

data.frame with columns for sep, p.intro, discounted prior, probability of freedom, equilibrium probability of freedom and equilibrium prior

Examples

Run this code
# NOT RUN {
# examples for pfree.calc
pfree.calc(0.8, 0.01, 0.5)
pfree.calc(0.8, 0.01, 0.5, FALSE)
pfree.calc(rep(0.6,24), 0.01, 0.5)
pfree.calc(rep(0.6,24), 0.01, 0.5, FALSE)
pfree.calc(runif(10, 0.4, 0.6), 0.01, 0.5)
pfree.calc(runif(10, 0.4, 0.6), runif(10, 0.005, 0.015), 0.5)
# }

Run the code above in your browser using DataLab