impact_eval | R Documentation |
Impact Evaluation of Treatment Effects
impact_eval( data, endogenous_vars, treatment, heterogenous_vars, cluster_vars = "0", fixed_effect_vars = "0", control_vars )
data |
A data.frame, tibble or data.table |
endogenous_vars |
Vector of Y's on which treatment effects will be evaluated |
treatment |
Variable indicating the treatment status |
heterogenous_vars |
Vector of variables for which you wish to assess treatment distributions/heterogeneities. |
cluster_vars |
Vector of variables to cluster the standard errors. Default is without clustered std errors |
fixed_effect_vars |
Vector of variables to add as fixed effects. Default is without fixed effects |
control_vars |
Vector of variables to control for in the evaluation. Default is without controls |
This function carries out the evaluation of treatment effects on endogenous variables. It automatically runs the regressions of all the endogenous_vars supplied & all the combinations of endogenous_vars and heterogenous_vars. Additionally, the function has the option of include fixed_effects, controls and cluster variables for clustered std errors.
impact_eval() returns a list of regression tables. The names of the list are the same as the endogenous variables. for heterogeneities the names are endogenous_var_heterogenous_var
data <- data.frame(y_1 = rnorm(n = 100, mean = 100, sd = 15), y_2 = rnorm(n = 100, mean = 8, sd = 2), treat = rep(c(0,1,2,3), each = 25), heterogenous_var1 = rep(c("X_Q1", "X_Q2", "X_Q3", "X_Q4"), times = 25), cluster_var1 = rep(c(1:5), times = 20), fixed_effect_var1 = rep(c(1,2), times = 50), control_var1 = rnorm(n = 100, mean = 20, sd = 1)) evaluation<-impact_eval(data = data, endogenous_vars = c("y_1", "y_2"), treatment = "treat", heterogenous_vars = c("heterogenous_var1"), cluster_vars = "cluster_var1", fixed_effect_vars = c("fixed_effect_var1"), control_vars = c("control_var1"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.