R02AR: Title Calculate attack rate from basic reproduction number

View source: R/final_size.R

R02ARR Documentation

Title Calculate attack rate from basic reproduction number

Description

Title Calculate attack rate from basic reproduction number

Usage

R02AR(R0, tol = 0.01)

Arguments

R0

a value or vector of values representing the basic reproduction number, must be >=0

tol

a single >=0 value giving the tolerance for the calculated attack rate

Value

AR, the attack rate, calculated using the relationship: R0 = -log(1-AR)/AR

Examples


## Calculate the attack rate for a specific value of the reproduction number
R02AR(2) # returns the AR for an R0 of 2

## plot the relationship between R0 and attack rate
x <- seq(1.01, 5, 0.01)
plot(x, R02AR(x), type = "l", xlab = "R0", ylab = "Attack rate")


epitrix documentation built on Jan. 14, 2023, 1:16 a.m.