Dear Statalist friends,
I was reading through some DD materials and I got confused about how to code in the case of panel data, specially with more than 2 time-periods. I was trying to follow Imbens/Wooldridge page 8, Lecture Notes 10, Summer ’07 (available at: http://www.nber.org/WNE/lect_10_diffindiffs.pdf)
I tried the following commands:
Option (1) and (2) gave me the same results, but option (2) was only applicable with 2 time periods since you have to create the first difference. Could it be possible to replicate with more time periods?
The option (3) gave me different SE and T values, although the same coefficient and p-value.
The option (4) was completely different and that is why I think is wrong. Is there any way to fit a DD-panel with more than 2 periods with the reg command?
Please, I will be very grateful if you could please tell me how to specify correctly the DD-panel regression with each command to better understand what was wrong in each of them.
Thanks a lot!
I was reading through some DD materials and I got confused about how to code in the case of panel data, specially with more than 2 time-periods. I was trying to follow Imbens/Wooldridge page 8, Lecture Notes 10, Summer ’07 (available at: http://www.nber.org/WNE/lect_10_diffindiffs.pdf)
I tried the following commands:
Code:
*1* From Clyde Schechter - Statalist // https://www.statalist.org/forums/forum/general-stata-discussion/general/1377739-difference-in-differences-regression xtset id xtreg outcome i.treated##i.post_treat i.year, fe *2* Bernal & Peña - Universidad de los Andes gen delta_outcome=outcome2-outcome1 // first difference between time periods reg delta_outcome i.treated *3* DIFF command diff outcome, t(treated) p(year) *4* OLS - reg reg outcome i.treated i.year i.id
The option (3) gave me different SE and T values, although the same coefficient and p-value.
The option (4) was completely different and that is why I think is wrong. Is there any way to fit a DD-panel with more than 2 periods with the reg command?
Please, I will be very grateful if you could please tell me how to specify correctly the DD-panel regression with each command to better understand what was wrong in each of them.
Thanks a lot!
Comment