Hi All,



Question 1:

I'm running a difference-in-differences analysis on yearly repeated cross-sectional data. I'd like to include the area specific linear time trend.

xtset id year

xtreg Y x1 x2 c.year_sequence # i.id, fe r


(note: year is 2005 to 2018, year_sequence is from 1 to 14)


Are these codes correct?



Question 2:


I'm running a difference-in-differences analysis on yearly level data (t). I have multiple areas(i) and multiple jobs (j). How to control for the area specific trend (not linear)?

Is that i.year ## i.area correct?

xtset area year

xtreg Y x1 x2 i.job i.area ## i.year , fe r


Thanks, appreciated!!!!


Happy New Year!