Consider a panel data where -gvkey- is the panel identifier and -fyear- is the time variable in the panel.
Suppose the following treatment occurs at the industry level
The policy change occurred in 2020.
I test the following three diff-in-diff using -reghdfe- and -xtreg-:
Specification #1:
Specification #2:
Specification #3:
My questions:
(1) How are these three specifications different?
(2) I am getting similar coefficients for #2 and 3 but completely different coefficient for #1. Why is this the case?
(3) Which is the correct diff-in-diff specification?
Suppose the following treatment occurs at the industry level
Code:
gen assignment=0 replace assignment =1 if (industry == 101 | industry == 102) g period = 0 replace period = 1 if fyear >= 2020 g treatment = period * assignment g two_before =. replace two_before=1 if fyear==2018 replace two_before=1 if fyear==2019 replace two_before=1 if fyear==2020 gen D_before = sum(two_before), by (gvkey) g two_after =. replace two_before=1 if fyear==2021 replace two_before=1 if fyear==2022 replace two_before=1 if fyear==2023 gen D_after = sum(two_after), by (gvkey)
Code:
gen period = 0 replace period = 1 if fyear>=2020
Specification #1:
Code:
reghdge y i.treatment i.fyear if ( fyear>=2018 & fyear<=2022) & (industry == 101 | industry == 102) & D_before>=2 & D_after>=2, absorb(gvkey) cluster(gvkey)
Code:
reghdfe y i.treatment i.fyear, absorb(gvkey fyear) cluster (gvkey)
Code:
xtreg y i.treatment i.fyear, fe vce(cluster gvkey)
My questions:
(1) How are these three specifications different?
(2) I am getting similar coefficients for #2 and 3 but completely different coefficient for #1. Why is this the case?
(3) Which is the correct diff-in-diff specification?
Comment