View source: R/predict_contacts_1y.R
predict_contacts_1y | R Documentation |
Provides a predicted rate of contacts for contact ages.
Take an already fitted model of contact rate and predict the
estimated contact rate, and standard error, for all combinations of the
provided ages in 1 year increments. So if the minimum age is 5, and the
maximum age is 10, it will provide the estimated contact rate for all age
combinations: 5 and 5, 5 and 6 ... 5 and 10, and so on. This function is
used internally within predict_contacts()
, and thus
predict_setting_contacts()
as well, although it can be used by itself.
See examples for more details, and details for more information.
predict_contacts_1y(model, population, age_min = 0, age_max = 100)
model |
A single fitted model of contact rate (e.g.,
|
population |
a dataframe of age population information, with columns
indicating some lower age limit, and population, (e.g.,
|
age_min |
Age range minimum value. Default: 0 |
age_max |
Age range maximum value, Default: 100 |
Prediction features are added using add_modelling_features()
.
These features include the population distribution of contact ages,
fraction of population in each age group that attend school/work as well
as the offset according to the settings on all combinations of the
participant & contact ages.
Data frame with four columns: age_from
, age_to
, contacts
, and
se_contacts
. This contains the participant & contact ages from the
minimum and maximum ages provided along with the predicted rate of
contacts and standard error around the prediction.
fairfield <- abs_age_lga("Fairfield (C)")
fairfield
# predict the contact rates in 1 year blocks to Fairfield data
fairfield_contacts_1 <- predict_contacts_1y(
model = polymod_setting_models$home,
population = fairfield,
age_min = 0,
age_max = 2
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.