partial-prediction | R Documentation |
Partial predictions allow you to explore and understand the impact of each of the covariates used in the conmat GAM model. See 'Details' for more information.
partial_effects(model, ages, ...)
## S3 method for class 'contact_model'
partial_effects(model, ages, ...)
## S3 method for class 'setting_contact_model'
partial_effects(model, ages, ...)
## S3 method for class 'setting_contact_model'
partial_effects_sum(model, ages, ...)
model |
A fitted contact model, with class |
ages |
vector of integer ages. |
... |
extra arguments. Currently not used. |
Partial predictive plots give a visual representation of the effect of each covariate on the model, or (equivalently) the effect of each setting on the total contact matrix. Positive values indicate more contacts in that region of the matrix compared to the null case, while negative values indicate less. Essentially, they represent the change in outcome variable on the model scale with a unit change in input variable.
Scales are not comparable across settings, as each setting has it's own intercept term which is not accounted for in partial effects.
data frame with 20 columns plus n rows based on expand.grid combination of ages. Contains transformed coefficients from ages.
partials_home <- partial_effects(
polymod_setting_models$home,
ages = 1:99
)
autoplot(partials_home)
# partial effects for all settings
partials_setting <- partial_effects(
polymod_setting_models,
ages = 1:99
)
autoplot(partials_setting)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.