Predict setting contacts
predict_setting_contacts.Rd
Predict contact rate for each setting. Note that this function is
parallelisable with future
, and will be impacted by any future
plans
provided.
Usage
predict_setting_contacts(
population,
contact_model,
age_breaks,
per_capita_household_size = NULL,
model_per_capita_household_size = get_polymod_per_capita_household_size()
)
Arguments
- population
population
- contact_model
contact_model
- age_breaks
age_breaks
- per_capita_household_size
Optional (defaults to NULL). When set, it adjusts the household contact matrix by some per capita household size. To set it, provide a single number, the per capita household size. More information is provided below in Details. See
get_per_capita_household_size()
function for a helper for Australian data with a workflow on how to get this number.- model_per_capita_household_size
modelled per capita household size. Default values for this are from
get_polymod_per_capita_household_size()
, which ends up being 3.248971
Details
We use Per-capita household size instead of mean household size. Per-capita household size is different to mean household size, as the household size averaged over people in the population, not over households, so larger households get upweighted. It is calculated by taking a distribution of the number of households of each size in a population, multiplying the size by the household by the household count to get the number of people with that size of household, and computing the population-weighted average of household sizes. We use per-capita household size as it is a more accurate reflection of the average number of household members a person in the population can have contact with.
Examples
# don't run as it takes too long to fit
if (FALSE) {
fairfield_age_pop <- abs_age_lga("Fairfield (C)")
fairfield_age_pop
polymod_contact_data <- get_polymod_setting_data()
polymod_survey_data <- get_polymod_population()
setting_models <- fit_setting_contacts(
contact_data_list = polymod_contact_data,
population = polymod_survey_data
)
synthetic_settings_5y_fairfield <- predict_setting_contacts(
population = fairfield_age_pop,
contact_model = setting_models,
age_breaks = c(seq(0, 85, by = 5), Inf)
)
fairfield_hh_size <- get_per_capita_household_size(lga = "Fairfield (C)")
fairfield_hh_size
synthetic_settings_5y_fairfield_hh <- predict_setting_contacts(
population = fairfield_age_pop,
contact_model = setting_models,
age_breaks = c(seq(0, 85, by = 5), Inf),
per_capita_household_size = fairfield_hh_size
)
}