Regression and categorical variables for dummies

If a predictor variable is categorical (aka a factor), a variable with a finite number of levels like male/female or Democrat/Republican/independent, linear regression can still flourish. Software will convert each factor into the same number of dummy variables} as there are levels in the factor.

Typically the alphabetically first level becomes the reference level, which is the zero-coded dummy factor, while the other levels are the comparison levels. Since the intercept is the expected mean when the predictors equal zero, the intercept indicates the mean value for the reference group, the Democratic party (as all other comparison group levels have a 1 when the reference group has a 0). The regression model’s output does not show the reference level; the coefficients of the other levels are measured with respect to the reference level.

The coefficient for the comparison levels tells how much higher or lower they are than the reference level. The coefficients of each of the dummy variables are equal to the difference between the mean of the level coded 1 and the mean of the reference group. For our data, the coefficient for Republican is -976, the average difference in number of practicing lawyers between the reference group category (Democrat) and the category coded 1 (Republican) therefore being that much less than the intercept value (the Democrat mean).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.