Description Usage Arguments Details Value Examples
Models the age-mixing pattern for the population simulated in Simpact. The user specifies a time point, time window, and age group for which they would like to obtain a summary of the age-mixing pattern. The user also specifies whether only relationships that started within the time window should be used.
1 2 | amp.modeller(dataframe, agegroup, timepoint, timewindow, start = FALSE,
SHIMS = TRUE, method = "lmer")
|
dataframe |
The dataframe that is produced by
|
agegroup |
Boundaries of the age group that should be retained, e.g. c(15, 30). The interval is closed on the left and open on the right. |
timepoint |
Point in time during the simulation to be used in the calculation. |
timewindow |
The length of time before the timepoint for which relationships should be included, e.g. 1, representing one year before the timepoint. This should be a whole number. |
start |
This is a logical indicating that only relationships starting after the beginning of the window should be used. If start = FALSE relationships could start before the time window. This is the default. |
SHIMS |
Should only the three most recent relationships be kept, like in the SHIMS survey? |
method |
Should the |
The amp.modeller
function can use either the link[nlme]{lme}
or
the link[lme4]{lmer}
function to build a linear mixed effects model
regressing the partner's age at the time the relationship started on his/her
own age at the beginning of the relationship. The models are stratified by
gender. Each person can have more than one relationship so a random intercept
at the level of the person is added to the model.
The models built with link[nlme]{lme}
also explicitly account for
heteroskedastic variance, since the variance in partner ages may grow for
older ages.
The function produces a fitted model.
returns a model fitted with link[nlme]{lme}
or
link[lme4]{lmer}
1 2 3 | data(persreldf)
agemixpatdat <- amp.modeller(dataframe = persreldf, agegroup = c(18, 50),
timepoint = 30, timewindow = 0.5, start = FALSE, SHIMS = TRUE, method = "lmer")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.