Learn R Programming

epitrix (version 0.4.0)

AR2R0: Title Calculate basic reproduction number from attack rate

Description

Title Calculate basic reproduction number from attack rate

Usage

AR2R0(AR)

Value

R0, the basic reproduction number, calculated as -log(1-AR)/AR

Arguments

AR

the attack rate; a value or vector of values between 0 and 1

Examples

Run this code

## Calculate R0 for an attack rate of 50%
AR2R0(0.5)

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

Run the code above in your browser using DataLab