4 Advanced treatment assignments
So far, we have focused on estimation for a fixed treatment assignment: assign to treatment 1 with probability 1.
We might also want to know about the gap-closing estimand
- if we assigned people to treatment stochastically
- if each person’s assignment were individualized
4.1 Stochastic treatments
We may want to study a counterfactual where treatment is assigned with some probability between 0 and 1. The counterfactual_assignments
argument can handle this possibility.
For example, consider the gap-closing estimand if assigned to treatment 1 with each probability .75.
estimate_stochastic <- gapclosing(
data = simulated_data,
counterfactual_assignments = .75,
outcome_formula = formula(outcome ~ confounder + category*treatment),
treatment_formula = formula(treatment ~ confounder + category),
category_name = "category"
)
4.2 Individualized treatments
Treatment may also be different (and possibly stochastic) for each unit in the counterfactual world of interest.
For example, suppose we assign those in Category A to treatment 1 with probability .5, those in Category B to treatment with probability .4, and those in Category C to treatment with probability .3. In this case, counterfactual_assignments
will be set to a vector of length nrow(data)
.
our_assignments <- case_when(simulated_data$category == "A" ~ .5,
simulated_data$category == "B" ~ .4,
simulated_data$category == "C" ~ .3)
estimate_stochastic <- gapclosing(
data = simulated_data,
counterfactual_assignments = our_assignments,
outcome_formula = formula(outcome ~ confounder + category*treatment),
treatment_formula = formula(treatment ~ confounder + category),
category_name = "category"
)
That intervention would close the B - A gap by 31%.