data(df_oes)
# Single binary treatment:
fit <- lm(y1 ~ x1, df_oes)
# Multiple treatment conditions:
fit2 <- lm(y2 ~ x2, df_oes)
# Using HC2 SE's from lm_robust():
fit_robust <- estimatr::lm_robust(y1 ~ x1, df_oes)
fit_robust2 <- estimatr::lm_robust(y2 ~ x2, df_oes)
# Using covariates and lm():
fit_covars <- lm(y2 ~ x2 + z1 + z2 + z3, df_oes)
# Using covariates and lm_robust():
fit_covars_robust <- estimatr::lm_robust(y2 ~ x2 + z1 + z2 + z3, df_oes)
# Example specifying number of treatment arms:
oes_prep(fit, treatment_arms = 1)
# Example specifying name of treatment variable:
oes_prep(fit, treatment_vars = "x1")
# Example reporting outcomes as percentages:
oes_prep(fit, treatment_vars = "x1", scale = "percentage")
# Example specifying several treatment arms, labels, etc.:
oes_prep(fit2, treatment_arms = 3,
treatment_labels = c(
"Email",
"Email +\nReward",
"Email +\nRisk"),
control_label = "Status Quo",
scale = "percentage")
# Examples with lm_robust():
oes_prep(fit_robust, treatment_arms = 1)
oes_prep(fit_robust2, treatment_arms = 3)
# Examples with covariates:
oes_prep(fit_covars, treatment_arms = 3)
oes_prep(fit_covars_robust, treatment_arms = 3)
Run the code above in your browser using DataLab