I have a question where I am not sure about the answer:

A linear model has the following characteristics:

*A dependent variable ($y$)

*One continuous variable ($x_l$), including a quadratic term ($x_1^2$)

*One categorical ($d$ with 3 levels) predictor variable and an interaction term ($d \times x_1$)

How many parameters, including the intercept, are associated with this model?

So I thought about: $y=\beta_0 + \beta_1 x_1 + \beta_2 x_1^2 + \beta_3 d$ + $\beta_4dx_1$

I thought I need 5 parameters for this model, but I was told the answer would be 7. So I guess I did the interaction wrong. So it seems to me I have to model each level of d with x1 with a single interaction. But how would I write this down and why do I need this?


2 Answers 2


The model has 7 parameters because of the 3-category categorical variable which will have 2 ``main effects'' parameters in the model (1 of the categories is omitted as the reference category). There will also be a parameter for the interaction between each of the levels of the categorical variable with the continuous variable:

  1. Continuous variable main effect
  2. Quadratic effect
  3. Category 1 main effect
  4. Category 2 main effect
  5. Continuous variable $\times$ category 1 interaction effect
  6. Continuous variable $\times$ category 2 interaction effect
  7. Intercept

Using your notation, the regression equation should be $$y=\beta_0 + \beta_1 x_1 + \beta_2 x_1^2 + \beta_3 d_1 + \beta_4 d_2 + \beta_5d_1x_1 + \beta_6d_2x_1$$


I think you need to consider your categorical variable d as three different dummy variables following the value d can take. That would make two more variables, hence 7 variables in total. Does that make any sense?

  • $\begingroup$ Could you expand on how the dummies work for the OP? $\endgroup$
    – Glen_b
    Jun 25, 2014 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.