Reputation: 319
Using factor variables in Stata in a regression it's easy to choose which main effect to omit. However, as in the below example, sometimes I wish to choose which additional collinear factor variable to omit, where here the collinearity is due to the fixed effects. I thought the ib4 notation would do it, but Stata seems to ignore this, instead omitting the interaction between indicators for treat=1 and t=8. How can I force omission of the interaction between indicators for treat=1 and t=4?
clear
set obs 100
gen id=_n
gen treat=runiform()>.5
expand 8
bysort id: gen t=_n
gen y_0=rnormal()+3*t
gen y_1=rnormal()+5*t+5
gen post=t>4
gen posttreat=post*treat
gen y=cond(posttreat==1,y_1,y_0)
areg y ib4.t i.treat#ib4.t, absorb(id)
Upvotes: 0
Views: 2263