r0_conversions {finalsize} | R Documentation |
Converts between epidemiological parameters related to
Description
Converts between and the transmission rate
, or calculates
the effective reproduction number
for a population,
while accounting for population characteristics including demographic
heterogeneity in social contacts, heterogeneity in the demographic
distribution, and heterogeneity in susceptibility to infection.
Uses the R0 (), contact matrix (
),
population (
), and infectious period (
)
to calculate the transmission rate using the following equation.
where denotes the eigenvalues of the matrix
which is
calculated from the social contacts matrix scaled by the number of
individuals in each demographic and susceptibility group in the population.
Usage
lambda_to_r0(
lambda,
contact_matrix,
demography_vector,
susceptibility,
p_susceptibility,
infectious_period = 1.8
)
r0_to_lambda(
r0,
contact_matrix,
demography_vector,
susceptibility,
p_susceptibility,
infectious_period = 1.8
)
r_eff(r0, contact_matrix, demography_vector, susceptibility, p_susceptibility)
Arguments
lambda |
The transmission rate of the disease, also called the 'force of
infection' ( |
contact_matrix |
Social contact matrix. Entry |
demography_vector |
Demography vector. Entry |
susceptibility |
A matrix giving the susceptibility of individuals in
demographic group |
p_susceptibility |
A matrix giving the probability that an individual
in demography group |
infectious_period |
Duration of the infectious period in days. Default value is 1.8 days. |
r0 |
The basic reproductive number |
Details
Given the transmission rate (),
social contacts matrix (
), demography (
), the
distribution
of each demographic group
into
susceptibility groups
, and the infectious period (
)
-
r_eff()
calculates the effective reproductive number; -
lamda_to_r0()
calculates thefrom the transmission rate as
-
r0_to_lambda()
calculates the transmission rate asNote that this is also called the 'force of infection' and is different from the effective transmission rate often denoted
.
Here, denotes the eigenvalues of the matrix
which is
calculated from the social contacts matrix scaled by the number of
individuals in each demographic and susceptibility group in the population.
Value
Returns a single number for the calculated value.
Examples
#### Prepare data ####
# Get example dataset and prepare contact matrix and demography
data(polymod_uk)
contact_matrix <- polymod_uk$contact_matrix
demography_vector <- polymod_uk$demography_vector
# define lambda
lambda <- 0.3
# define infectious period of 5 days
infectious_period <- 5
# define the number of age and susceptibility groups
n_demo_grps <- length(demography_vector)
n_risk_grps <- 3
# In this example, risk varies across groups
susceptibility <- matrix(
data = c(0.5, 0.7, 1.0), nrow = n_demo_grps, ncol = n_risk_grps
)
# risk does not vary within groups
p_susceptibility <- matrix(
data = 1, nrow = n_demo_grps, ncol = n_risk_grps
)
# p_susceptibility rows must sum to 1.0
p_susceptibility <- p_susceptibility / rowSums(p_susceptibility)
#### Effective R ####
r0 <- 2.0
r_eff(
r0 = r0,
contact_matrix = contact_matrix,
demography_vector = demography_vector,
susceptibility = susceptibility,
p_susceptibility = p_susceptibility
)
#### Transmission rate to R0 ####
lambda_to_r0(
lambda, contact_matrix, demography_vector,
susceptibility, p_susceptibility,
infectious_period
)
#### R0 to Transmission rate ####
r0 <- 1.5
r0_to_lambda(
r0, contact_matrix, demography_vector,
susceptibility, p_susceptibility,
infectious_period
)