I have a question about choosing the base level of a factor variable in an interaction term with main effects only when using xtreg. I presume I'm not the first person to run into this issue, but I cannot find any guidance in the Stata manual or old forum posts to help. The issue occurs when I am trying to set a certain base category in an interaction term. My choice of base category is ignored by Stata. Specifically, I try to set the second category of the variable x2 as base in an interaction of x1 with x2. However, in the output the fourth category of x2 is omitted, instead of the second category being the base, as specified (see below the relevant part of the output):
Code:
xtreg y c.x1#ib2.x2 i.year , fe robust allbaselevels | Robust y | Coef. Std. Err. t P>|t| [95% Conf. Interval] ---------------------------+---------------------------------------------------------------- x2#c.x1 | 1 | .8954887 .6693987 1.34 0.189 -.4584979 2.249475 2 | .1291345 .6481673 0.20 0.843 -1.181908 1.440177 3 | -.8268249 .4934912 -1.68 0.102 -1.825005 .1713553 4 | 0 (omitted) | year | 1400 | 0 (base) 1425 | .1343599 .1536929 0.87 0.387 -.1765132 .4452331 1450 | .3906657 .2905451 1.34 0.187 -.1970173 .9783487 1475 | 1.199689 .4185224 2.87 0.007 .3531474 2.04623 ...
Thank you so much
Felix
0 Response to Problem setting base category in interaction term
Post a Comment