Dear Everyone,

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)
My question is: does this code mean that I am having both time and fixed effects. The time fixed effects are donated by i.year, while I did not have i.city because I have used "xi" at the beginning of the code. But I think xi is not for the city fixed effects and thus I must add i.city.

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