Title: | Epidemiological analysis using social mixing matrices |
---|---|
Description: | Provides methods to conduct epidemiological analysis using social mixing matrices, such as calculating contact-adjusted immunity levels or age distributions of epidemics. |
Authors: | Sebastian Funk [aut, cre] |
Maintainer: | Sebastian Funk <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1 |
Built: | 2024-08-19 02:46:38 UTC |
Source: | https://github.com/sbfnk/epimixr |
This takes a contact survey to derive a contact matrix and rescales contacts to represent contacts with susceptibles. This is then combined with information on the basic reproduction number R0 to calculate the effective or net reproduction number.
adjust_immunity(mixing_matrix, immunity, vector = FALSE)
adjust_immunity(mixing_matrix, immunity, vector = FALSE)
mixing_matrix |
A mixing matrix, as returned by
|
immunity |
immunity profile; this should be given as a vector of the same length as the number of rows/columns of the mixing matrix; each element of the vector should contain a value <1 representing the proportion of the population immune in the corresponding age group; any element set to "herd" will be set to 1-1/R0 |
vector |
if TRUE, will return the eigenvector corresponding to the dominant eigenvector instead of adjusted immunity; this corresponds to the expected stable age distribution of infections in case of an outbreak |
a list contain vectors of adjusted immunities
Sebastian Funk
library("socialmixr") mixing <- contact_matrix(survey = polymod, age.limits = c(0, 5, 10)) adjust_immunity(mixing$matrix, immunity = c(0, 0.5, 0.8))
library("socialmixr") mixing <- contact_matrix(survey = polymod, age.limits = c(0, 5, 10)) adjust_immunity(mixing$matrix, immunity = c(0, 0.5, 0.8))
calculates the age distribution in an epidemic setting using the iterative method of: J Wallinga, P Teunis, M Kretschmar (2006) Using Data on Social Contacts to Estimate Age-specific Transmission Parameters for Respiratory-spread Infectious Agents. Am J Epidemiol 164(10), 945-946.
epidemic_age_dist( mixing_matrix, r_0, immunity = 0, final_size_start = 0.01, tol = 1e-05 )
epidemic_age_dist( mixing_matrix, r_0, immunity = 0, final_size_start = 0.01, tol = 1e-05 )
mixing_matrix |
A mixing matrix or set of mixing matrices, as returned
by |
r_0 |
basic reproduction number |
immunity |
proportion immune before the epidemic |
final_size_start |
starting value for inidence |
tol |
tolerance for stopping the iteration |
A matrix of the final size(s) (proportion of susceptibles infected)
in each age group (one row per matrix contained in mixing
)
library("socialmixr") mixing <- contact_matrix(survey = polymod, age.limits = c(0, 5, 10)) epidemic_age_dist(mixing$matrix, r_0 = 5, immunity = 0.50)
library("socialmixr") mixing <- contact_matrix(survey = polymod, age.limits = c(0, 5, 10)) epidemic_age_dist(mixing$matrix, r_0 = 5, immunity = 0.50)
Project immunity from a baseline via vaccination coverage rates
project_immunity( baseline_immunity, baseline_year, year, coverage, schedule, maternal_immunity, efficacy )
project_immunity( baseline_immunity, baseline_year, year, coverage, schedule, maternal_immunity, efficacy )
baseline_immunity |
baseline immunity, as a named vector; the names correspond to lower limits of the age groups, and the vector itself to the corresponding levels of immunity. |
baseline_year |
year at which baseline immunity is taken (corresponding
to a column in the |
year |
year to project to |
coverage |
coverage with multiple vaccine doses, given as a matrix in which each row is a dose and each (named) column a year |
schedule |
the ages at which vaccines are given (in years). |
maternal_immunity |
the proportion maternally immune. |
efficacy |
vaccine efficacy. |
a data frame of immunity levels by age group (as in
baseline_immunity
).
Sebastian Funk <[email protected]>
baseline_immunity <- c(`2` = 0.85, `5` = 0.9, `10` = 0.95) coverage <- matrix(rep(0.9, 10), nrow = 2) colnames(coverage) <- as.character(seq(2015, 2019)) project_immunity( baseline_immunity, 2018, 2019, coverage = coverage, schedule = c(1, 2), 0.5, 0.95 )
baseline_immunity <- c(`2` = 0.85, `5` = 0.9, `10` = 0.95) coverage <- matrix(rep(0.9, 10), nrow = 2) colnames(coverage) <- as.character(seq(2015, 2019)) project_immunity( baseline_immunity, 2018, 2019, coverage = coverage, schedule = c(1, 2), 0.5, 0.95 )