# Fixed effect panel regression with categorical variable

I have a fixed effect panel regression model using 'plm' function in R along with its 'within' option. It has three dummy variables x1, x2, and x3 representing four categories for my binary variables. So if all x1, x2, and x3 are 0, the forth category is 1 automatically. All variables and data are time varying.

I use these in my fixed effect panel regression using 'plm' command with its 'within' option. It has one more numerical variable x4 which is not binary. However, the regression has no intercept when I run the fixed effect panel regression.

Y = ax1 + bx2 + cx3 + dx4

If I want to find the effect of forth category I need to set all x1, x2, x3 as zeros. If so, what should I set for x4 to find the effect of the fourth category?

If you chose to have no intercept, you actually need a dummy variable for all four categories rather than just 3. That is because somewhere in the model you need to "place" the effect of category 4 and this place cannot by x4 because it is already measuring something else. Thus, the specification

$$y = \beta_1d_1 + \beta_2d_2 + \beta_3d_3 + \beta_4d_4 + \beta_5x +\epsilon$$ is the same as $$y = \beta_0 + \beta_1d_1 + \beta_2d_2 + \beta_3d_3 + \beta_5x +\epsilon$$ with $x$ being your continuous variable and $d$ your categories. You need either the intersect $\beta_0$ or a categorical variable $d_4$ to include the effect of your fourth category in the model.

• Thank you. Actually my model is a panel regression using fixed effect method which does not have intercept from its definition. It still has an error term but is not measurable. If so, shall I still follow your method..? – Eric Sep 1 '17 at 22:28
• I just fixed my question. Please check. – Eric Sep 1 '17 at 22:45
• The fixed effect model does not give intercept variable consistently across all other analysis. I did not set this up but it automatically does so. However, random effect model gives intercepts. – Eric Sep 1 '17 at 23:07
• So, what I am concerned is whether I should regard intercept as zero or still follow your method or do something else. – Eric Sep 1 '17 at 23:15