I have a specific question about indicator/ dummy variables in a model. Right now, I have a set of data over about a year, with various variables such as temperature and operational units. Also in this are indicator variables to indicate things such as 0 or 1 for production day/ non production day. These are all then used in excel using linear regression. I have been trying to research the statistical validity of this, specifically using indicator variables and non-indicator variables.

Additionally, there are some indicator variables that are dependent on another independent variable already included. For example, an indicator to show whether the operational units are above or below a certain value. I have been researching this but have not found anything specific on this case and whether this can still be done with linear regression.

  • 1
    $\begingroup$ It’s fine to include indicator variables. That’s how a lot of experimental design will work. ANOVA is regression on indicator variables. ANCOVA uses a mix of indicator variables and a continuous variable. $\endgroup$
    – Dave
    Feb 29 '20 at 0:34

Using both continuous and categorical/indicator variables in a linear regression model is perfectly fine. For example, you can look at this post that describes several methods to code categorical variables for regression analyses, or this post. However, you should avoid the dummy variable trap, where several dummy variables are correlated to each other.

If your model includes a categorical variable coded from a continuous variable, as well as this continuous variable, there will be high multicollinearity (predictor variables in your model will be strongly correlated), which obscures the interpretation of the estimated parameters, and, in your case, simply means that variables in your model are redundant. It is better to select either the continuous variable or the categorical variable coded from it.

  • $\begingroup$ (+1) I wouldn't say correlated variables "violates the assumptions of linear regression". Maybe something like "is less than ideal if you'd like to interpret the estimated parameters". $\endgroup$ Feb 29 '20 at 1:00
  • 1
    $\begingroup$ Agreed - speaking of assumption violation might be too emphatic. I modified my answer accordingly. $\endgroup$ Feb 29 '20 at 1:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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