I would like to know if my code is correct. I am doing a regression (DiD) where I have dependent var (my_dep) the treatment dummy (policy) which indicates if the city has been treated or not at that year, control vars (x1, x2, x3) and I need to have time fixed effects and city fixed effects. Finally, I cluster the SD at the county level.
My code is:
Code:
xi: areg my_dep policy i.year x1 x2 x3, absorb(county) vce(cluster county)
So to have time and city fixed effects which code is the right one?
Code1:
Code:
xi: areg my_dep policy i.year x1 x2 x3, absorb(county) vce(cluster county)
Code2:
Code:
xi: areg my_dep policy i.year i.city x1 x2 x3, absorb(county) vce(cluster county)
Thank you in advance,
Ami
0 Response to Fixed effects code in a regression
Post a Comment