How do I use categorical predictors in a regression model?

Answer

Categorical predictors are represented with dummy (indicator) variables in a regression model. 

Think of a dummy variable as an on/off switch that has a value of 1 when the switch is turned on, and 0 when the switch is turned off. For example, if you want to include gender in a regression model, you could say that the variable has a value of 1 when the subject is female, and a value of 0 when the subject is male. The accompanying coefficient represents the change in the mean response from men to women. Note that the value of the dummy variable changes the location of the intercept but does not change the effect of other variables. 

It is also possible to fit models with categorical predictors that have more than two groups.

Topics

  • Last Updated Apr 23, 2021
  • Views 45
  • Answered By Dorian Frampton

FAQ Actions

Was this helpful? 0 0