Skip to contents

Regression Adjustment estimation of ATE or ATT

Usage

reg_adjust(df, w, y, xs, estimand = c("ATT", "ATE"))

Arguments

df

dataframe

w

treatment name

y

outcome name

xs

vector of covariate names

estimand

: runs Lin regression when "ATE" and Oaxaca-Blinder-Kitagawa when "ATT"

Value

fixest model object with robust standard errors (can be summarised again with different clusters)

Examples

data(lalonde.psid); data(lalonde.exp);
y = "re78"; w = "treat"; xs = setdiff(colnames(lalonde.psid), c(y, w))
cat("ATE in experimental sample \n")
#> ATE in experimental sample 
reg_adjust(lalonde.exp, 'treat', 're78', xs, "ATE")
#> OLS estimation, Dep. Var.: re78
#> Observations: 445 
#> Standard-errors: Heteroskedasticity-robust 
#>               Estimate Std. Error   t value Pr(>|t|)    
#> (Intercept)  7161.1626  3854.0114  1.858106 0.063848 .  
#> treat        1583.4679   666.9396  2.374230 0.018031 *  
#> age            40.7101    46.6679  0.872336 0.383520    
#> education      82.1505   210.8259  0.389661 0.696984    
#> black       -3131.3467  1349.7891 -2.319878 0.020823 *  
#> hispanic     -927.3272  1631.2494 -0.568477 0.570013    
#> married      -738.1153   976.8552 -0.755604 0.450307    
#> nodegree     -168.8203  1079.3594 -0.156408 0.875786    
#> ... 14 coefficients remaining (display them with summary() or use argument n)
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> RMSE: 6,270.0   Adj. R2: 0.059553
cat(" --------------------------- \n")
#>  --------------------------- 
cat("ATT in obs sample \n")
#> ATT in obs sample 
reg_adjust(lalonde.psid, 'treat', 're78', xs, "ATT")
#> OLS estimation, Dep. Var.: re78
#> Observations: 2,675 
#> Standard-errors: Heteroskedasticity-robust 
#>              Estimate Std. Error   t value   Pr(>|t|)    
#> (Intercept) -153.2337  1960.0359 -0.078179 9.3769e-01    
#> treat        687.8221   897.2045  0.766628 4.4337e-01    
#> age          -91.8914    25.1477 -3.654071 2.6312e-04 ***
#> education    601.2658   129.0186  4.660302 3.3134e-06 ***
#> black       -566.8557   459.8819 -1.232611 2.1783e-01    
#> hispanic    2518.2101  1324.6798  1.900995 5.7411e-02 .  
#> married     1378.8048   527.2069  2.615301 8.9654e-03 ** 
#> nodegree     787.1572   676.3425  1.163844 2.4459e-01    
#> ... 14 coefficients remaining (display them with summary() or use argument n)
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> RMSE: 10,008.9   Adj. R2: 0.586665
cat(" --------------------------- \n")
#>  ---------------------------