I'm fitting a model which has a factor variable as a control variable. I now wish to estimate the same model, adding an interaction between one of the factor's levels and my main variable of interest.
However, When I use the standard fvvarlist notation, stata drops all the other levels of the covar that use as controls. There's a simple way around this by generating a new binary variable according to the level of the covar i'm interested in, but I still don't understand why the "standard" syntax does this.
This is on stata 14.1 SE, windows 7 64bit. the following code will show the issue (the computer with stata is not connected to the internet)
Example:
note how the second regression doesn't estimate any of rep78's levels (except for 1.rep78), yet the third model does - Though to my understanding the two models should be equivalent...
However, When I use the standard fvvarlist notation, stata drops all the other levels of the covar that use as controls. There's a simple way around this by generating a new binary variable according to the level of the covar i'm interested in, but I still don't understand why the "standard" syntax does this.
This is on stata 14.1 SE, windows 7 64bit. the following code will show the issue (the computer with stata is not connected to the internet)
Example:
Code:
sysuse auto2 reg price mpg i.rep78 reg price c.mpg##1.rep78 i.rep78 gen bin = 1.rep78 reg price c.mpg##bin i.rep78
Comment