"A Simple Transformation Approach to Difference-in-Differences Estimation for Panel Data"
Available on SSRN https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4516518
Basic set up
-
Time Periods:
$t \in {1,...,T}$ - Time dummies:
$f02_t, ...,f0T_t$ - i.e.,
$f04 =1$ if$t=4$
- Time dummies:
-
First intervention occurs at
$S$ ,$1 < S \leq T$ -
There are two observable covariates
$X=(X_1, X_2)$
Step.1 For a given time period
Step.2 Using all of units, apply standard TE methods - such as linear RA, IPW, IPWRA, PS matching - to the cross section
Stata commands
Step.1 Genereting
xtset id year
bysort id: gen y_dot = y - (L1.y + L2.y + L3.y)/3 if f04
bysort id: replace y_dot = y - (L2.y + L3.y + L4.y)/3 if f05
bysort id: replace y_dot = y - (L3.y + L4.y + L5.y)/3 if f06
Step.2 Applying standard TE methods you want
In Step 2 of Procedure 3.1, you can use built-in commands in Stata.
For example, to get Rolling RA estimates for ATTs in each post-treatment period,
teffects ra (y_dot x1 x2) (d) if f04, atet
teffects ra (y_dot x1 x2) (d) if f05, atet
teffects ra (y_dot x1 x2) (d) if f06, atet
For Rolling IPWRA estimates for ATTs in each post-treatment period,
teffects ipwra (y_dot x1 x2) (d x1 x2) if f04, atet
teffects ipwra (y_dot x1 x2) (d x1 x2) if f05, atet
teffects ipwra (y_dot x1 x2) (d x1 x2) if f06, atet
For more details, please refer to "1.lee_wooldridge_rolling_common.do" and "1.lee_wooldridge_common_data.dta"
Basic set up
-
Time Periods:
$t \in {1,...,T}$ -
First unit is treated at
$S$ ,$1 < S \leq T$ -
Cohort Indicator, for
$g \in{S,...,T}$ -
$D_g=1$ if unit$i$ is first subjected to the intervention at time$g$ -
$D_\infty=1$ if unit is never treated in $ S,...,T$
-
-
There are two observable covariates
$X=(X_1, X_2)$
Step.1 For
Step.2 Choose as the control group the not-yet-treated units with
Step.3 Using the subset of data units (
Stata commands
Step.1 Genereting
xtset id year
%y_i44 , y_i45, y_i46
bysort id: gen y_44 = y - (L1.y + L2.y + L3.y)/3 if f04
bysort id: gen y_45 = y - (L2.y + L3.y + L4.y)/3 if f05
bysort id: gen y_46 = y - (L3.y + L4.y + L5.y)/3 if f06
%y_i55, y_i56
bysort id: gen y_55 = y - (L1.y + L2.y + L3.y + L4.y)/4 if f05
bysort id: gen y_56 = y - (L2.y + L3.y + L4.y +L5.y)/4 if f06
%y_i66
bysort id: gen y_66 = y - (L1.y + L2.y + L3.y + L4.y+L5.y)/5 if f06
Step.2 & 3 Applying standard TE methods you want
In Step 3 of Procedure 4.1, you can use built-in commands in Stata after selecting "control group" carefully.
For example, to get Rolling RA estimates for ATTs in each post-treatment period of g4,
%% Control group consists of g_{\infty} (=Never-treated group) , g_5 and g_6
teffects ra (y_44 x1 x2) (g4) if f04, atet
%% Now, Control group was reduced to g_{\infty} and g6
teffects ra (y_45 x1 x2) (g4) if f05 & ~g5, atet
%% Only g_{\infty} is in control group
teffects ra (y_46 x1 x2) (g4) if f06 & (g5 + g6 != 1), atet
For Rolling IPWRA estimates for ATTs in each post-treatment period of g4 at
%% Control group consists of g_{\infty} & g6
teffects ipwra (y_45 x1 x2) (g4 x1 x2) if f05 & ~g5, atet
For more details, please refer to "2.lee_wooldridge_rolling_staggered.do" and "2.lee_wooldridge_staggered_data.dta"