Description Usage Arguments Value Examples
A function to estimate age mixing matrices for user-supplied data. Choose between different distributions around mean partner age (Normal or Gamma), and either an identity or log link for the Gamma distribution. See "Revisiting Assumptions about Age Preferences in Mathematical Models of Sexually Transmitted Infection" (Easterly, et al., 2018) for details about the estimation procedures. For a function to estimate the best mixing structure for your data, see best_age_mixing
1 2 3 | estimate_age_mixing(choice_data, start_ages, distribution = c("gamma",
"normal"), link = c("identity", "log"), max_age = 74,
age_distribution = NULL)
|
choice_data |
a dataframe with chooser age, partner age, sex, and optional survey weights.
These columns should be named |
start_ages |
vector of the youngest ages included in each age group.
If |
distribution |
Provide the distribution of the errors around the mean partner age. Choose from "gamma" or "normal" distributions. |
link |
When |
max_age |
The non-inclusive right-hand endpoint of the oldest age group within the model population. Default is 74, so if the oldest age group begins at 60, the age interval is 60-73. Must be less than or equal to 100. |
age_distribution |
Optional: a vector of length |
A list, where MOME is the male age mixing matrix, FOME is the female age mixing matrix, AIC is the AIC of the estimated statistical model, and fits
has information on the fit (can be used for sensitivity analysis).
1 2 3 4 5 | data("mixage_sample_data")
agemix <- estimate_age_mixing(choice_data = mixage_sample_data,
start_ages = seq(12, 72, by = 2),
max_age = 74)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.