Skip to content

epiforecasts/socialmixr

Repository files navigation

Social mixing matrices for infectious disease modelling in R

CRAN version R-CMD-check Codecov test coverage

socialmixr is an R package to derive social mixing matrices from survey data.

Installation

The package can be installed using

install.packages("socialmixr")

The current development version can be installed using the remotes package

remotes::install_github("epiforecasts/socialmixr")

Usage

Contact matrices are computed through a small pipeline of composable functions: subsetting the survey, assigning age groups, optionally weighing participants, and computing the matrix. A minimal example using the included POLYMOD data:

library(socialmixr)
data(polymod)

polymod[country == "United Kingdom"] |>
  assign_age_groups(age_limits = c(0, 1, 5, 15)) |>
  compute_matrix()

Post-processing functions symmetrise(), split_matrix() and per_capita() can be piped after compute_matrix() to enforce symmetry, decompose the matrix, or convert to per-capita contact rates.

Documentation

For more on how to use the socialmixr package, see the introduction vignette.

Contributors

All contributions to this project are gratefully acknowledged using the allcontributors package following the allcontributors specification. Contributions of any kind are welcome!

Code

sbfnk, Bisaloo, lwillem, njtierney, alxsrobert, Degoot-AM, pearsonca, jarvisc1, jamesmbaazam, LloydChapman, mariabnd, ukhsa-tt

Issue Authors

bastistician, BlackEdder, Pinzo1, florpi, cchauve, thutran, dlaydon, deusthindwa, krivit, linyang17, cliu822, TimTaylor, NaomiWaterlow, aakhmetz, adamkucharski, chitrams, IsaacStopard, avallecam, maishaoshao, FrancescoBonacina, lucy-gf

Issue Contributors

vikkytom, bahadzie, joshwlambert

About

Derive social mixing matrices from survey data.

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors