An introduction using teacher pension preferences
April 29, 2025
Each teacher faced choices like this.
Teachers selected their preferred option in each of 5 sets.
Sets were randomized.
# Interaction model for our pension study
interaction_model <- svyglm(
selected ~ choice_salary * demog_age +
choice_pension * demog_age +
choice_pensiontype * demog_age,
family = quasibinomial(),
design = svy_design
)
# Extract AMCEs for interaction model
amces_interaction <- marginaleffects::avg_comparisons(interaction_model)
# For our pension study:
policy_options <- tribble(
~choice_salary, ~choice_pension, ~choice_pensiontype,
"10% higher", "20% lower", "Defined contribution", # Policy A
"Same", "Same", "Defined benefit" # Status quo
)
# Calculate preference shares by age group
policy_sim <- marginaleffects::predictions(
interaction_model,
newdata = policy_options,
type = "link"
) |>
group_by(demog_age) |>
mutate(probability = exp(estimate) / sum(exp(estimate)))
Go forth and experiment!