Hi StataListers
I am running a panel regression to uncover district-level trends. My code is
Each state has multiple districts.
My question is, if I want to include state-year interaction, does it still make sense to include i.state and i.year separately? I know that i.state##i.year will include i.state i.year i.state#i.year, whereas i.state#i.year will only include the interaction term. So I guess my precise question is should I use i.state##i.year or i.state#i.year? How does the interpretation change?
Also, if I want to use district-fixed effects, can I still include the state-year interaction? With that, my understanding is that I should only use i.state#i.year because otherwise there will be perfect collinearity between district and state--am I right?
I am running a panel regression to uncover district-level trends. My code is
Code:
xtset district_id year xtreg y x controls i.year i.state
My question is, if I want to include state-year interaction, does it still make sense to include i.state and i.year separately? I know that i.state##i.year will include i.state i.year i.state#i.year, whereas i.state#i.year will only include the interaction term. So I guess my precise question is should I use i.state##i.year or i.state#i.year? How does the interpretation change?
Also, if I want to use district-fixed effects, can I still include the state-year interaction? With that, my understanding is that I should only use i.state#i.year because otherwise there will be perfect collinearity between district and state--am I right?
Comment