Dear all,

I am trying to run a difference-in-difference fixed-effects model. The challenge here is that I have MULTIPLE periods and treatment did not take place in a particular year for all units. Whenever I use one of the commands below, the treated#post coefficient, which I am interested in, is omitted.

xtreg outcome i.treated##i.post i.year, fe vce(cluster unit)
xtreg outcome i.treated#i.post i.year, fe vce(cluster unit)

The only way to bring it back is to interact i.year with i.treated instead of i.post with i.treated (see below).
xtreg outcome i.treated##i.year, fe vce(cluster unit)

But if I do so, I do not account for the exact year in which a unit is treated but rather that a unit is generally treated or not. I do not think this is acceptable.

The other alternative I could think of is to use diff-in-diff random effects instead of diff-in-diff fixed effects, as follows:
xtreg outcome i.treated#i.post, re vce(cluster unit)

But I think fixed effects better reflect my data.

Any advice will be highly appreciated, thanks in advance.

Best regards,
Amira