View source: R/postprocess-matrix.R
| symmetrise | R Documentation |
Makes a contact matrix symmetric so that c_{ij} N_i = c_{ji} N_j,
where c_{ij} is the (i, j) entry and N_i is the population
of age group i. This is done by replacing each pair with half their sum,
weighted by population size.
symmetrise(x, survey_pop, symmetric_norm_threshold = 2, ...)
x |
a list as returned by |
survey_pop |
a data frame with columns |
symmetric_norm_threshold |
threshold for the normalisation factor before issuing a warning (default 2) |
... |
passed to |
x with $matrix replaced by the symmetrised version
data(polymod)
pop <- wpp_age("United Kingdom", 2005)
polymod |>
(\(s) s[country == "United Kingdom"])() |>
assign_age_groups(age_limits = c(0, 5, 15)) |>
compute_matrix() |>
symmetrise(survey_pop = pop)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.