Divides each column of the contact matrix by the population of the corresponding age group, giving the contact rate of age group i with one individual of age group j.
Arguments
- x
a list as returned by
compute_matrix(), with elementsmatrixandparticipants- survey_pop
a data frame with columns
lower.age.limitandpopulation(e.g. fromwpp_age())- ...
passed to
pop_age()for interpolation
Examples
data(polymod)
pop <- data.frame(
lower.age.limit = c(0, 5, 15),
population = c(3500000, 6000000, 50000000)
)
polymod |>
(\(s) s[country == "United Kingdom"])() |>
assign_age_groups(age_limits = c(0, 5, 15)) |>
compute_matrix() |>
per_capita(survey_pop = pop)
#>
#> ── Contact matrix (3 age groups) ──
#>
#> Ages: "[0,5)", "[5,15)", and "[15,Inf)"
#> Participants: 1011
#>
#> contact.age.group
#> age.group [0,5) [5,15) [15,Inf)
#> [0,5) 5.473684e-07 2.385965e-07 1.105263e-07
#> [5,15) 1.512605e-07 1.324346e-06 1.243137e-07
#> [15,Inf) 1.115570e-07 2.151217e-07 1.918820e-07