Chapter 3 Doubly Robust Estimator
Next we will implement our doubly robust estimator. We are combining our regression adjusted outcome model and our IPW using \(p\)-scores. We have two chances to get the correct specification with the doubly robust estimator.
\[ ATE_{DR} = \left[ E[Y^1]-E[Y^0]\right]+E\left[\frac{(Y-E[Y^1])*D}{p(x)}-\frac{(Y-E[Y^0])(1-D)}{(1-p(x))} \right] \]
The left-hand side is our OLS-based model and the right-hand side is our Inverse Probability Weighted Model. If we specified the OLS model correctly, our second term equals zero.
First, we will reload our data and do the trimming.
* Reload Data
use https://github.com/scunning1975/mixtape/raw/master/nsw_mixtape.dta, clear
drop if treat==0
*Now merge in the CPS controls from footnote 2 of Table 2 (Dehejia and Wahba 2002)
append using https://github.com/scunning1975/mixtape/raw/master/cps_mixtape.dta
gen agesq=age*age
gen agecube=age*age*age
gen edusq=educ*edu
gen u74 = 0 if re74!=.
replace u74 = 1 if re74==0
gen u75 = 0 if re75!=.
replace u75 = 1 if re75==0
gen interaction1 = educ*re74
gen re74sq=re74^2
gen re75sq=re75^2
gen interaction2 = u74*hisp
* Now estimate the propensity score
logit treat age agesq agecube educ edusq marr nodegree black hisp re74 re75 u74 u75 interaction1
predict pscore
* Checking mean propensity scores for treatment and control groups
sum pscore if treat==1, detail
sum pscore if treat==0, detail
* Trimming the propensity score
drop if pscore <= 0.1
drop if pscore >= 0.93.1 Calculate the \(ATE\) and \(ATT\) using Doubly Robust Estimator
Our Doubly Robust Estimator using teffects includes teffects ipwra (OUTCOME MODEL) (TREATMENT MODEL) In the first set of paratheses, we will use the variables to estimate the regression adjustment model or outcome model. In the second set of paratheses we will estimate the treatment model or the model for to estimate our \(p\)-scores.
Next, we will calculate the \(ATT\). Note: We have to rescale for the concavity of the logit.
gen re78_scaled = re78/1000
teffects ipwra (re78_scaled age agesq agecube educ edusq ///
marr nodegree black hisp re74 re75 u74 u75 interaction1) (treat age agesq agecube educ edusq marr nodegree ///
black hisp u74 u75 interaction1, logit), atetIteration 0: EE criterion = 3.017e-21
Iteration 1: EE criterion = 7.330e-29
Treatment-effects estimation Number of obs = 361
Estimator : IPW regression adjustment
Outcome model : linear
Treatment model: logit
------------------------------------------------------------------------------
| Robust
re78_scaled | Coefficient std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
ATET |
treat |
(1 vs 0) | 2.565509 .8702431 2.95 0.003 .8598639 4.271154
-------------+----------------------------------------------------------------
POmean |
treat |
0 | 3.873287 .4696333 8.25 0.000 2.952823 4.793752
------------------------------------------------------------------------------
We find that our estimate \(ATT\) is $2,566.
Next we will estimate the \(ATE\), and we use the option ate to specify that we want to estimate the \(ATE\).
teffects ipwra (re78_scaled age agesq agecube educ edusq ///
marr nodegree black hisp re74 re75 u74 u75 interaction1) (treat age agesq agecube educ edusq marr nodegree ///
black hisp u74 u75 interaction1, logit), ateIteration 0: EE criterion = 2.997e-21
Iteration 1: EE criterion = 1.369e-28
Treatment-effects estimation Number of obs = 361
Estimator : IPW regression adjustment
Outcome model : linear
Treatment model: logit
------------------------------------------------------------------------------
| Robust
re78_scaled | Coefficient std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
ATE |
treat |
(1 vs 0) | 1.608922 .6988993 2.30 0.021 .2391044 2.978739
-------------+----------------------------------------------------------------
POmean |
treat |
0 | 4.297229 .3749753 11.46 0.000 3.562291 5.032167
------------------------------------------------------------------------------
We find that our estimate \(ATE\) is $1,609.