With an intercept, a five-category factor needs how many indicators?
Categorical predictors and parallel lines
Decode reference groups and compare adjusted group means.
Key ideas
- Indicator variable
A variable coded 1 for a specified category and 0 otherwise. A k-category predictor uses k−1 indicators when the model includes an intercept.
- Reference group
The category with all its indicator variables set to zero. Read the coding or factor levels rather than guessing from coefficient signs.
- Parallel lines
A model with a numeric predictor and a group indicator but no interaction has equal slopes and different intercepts across groups.
- Adjusted group difference
The indicator coefficient estimates the group mean difference at the same values of the other predictors. Changing the reference category changes coefficient meanings but not predictions.
Formulas
Which procedure?
Building materials and cooling use
Daily cooling use is measured in kWh. Outdoor temperature is measured in degrees C. Brick is the reference material. This is an original example with composed R output.
coef(lm(kwh ~ temperature + material, data = buildings))
(Intercept) temperature materialWood
10.00 2.00 6.00For brick buildings, fitted kWh = 10 + 2(temperature).
For wood buildings, fitted kWh = 16 + 2(temperature).
At 20 degrees C, fitted use is 50 kWh for brick and 56 kWh for wood.
The wood coefficient compares mean use at the same temperature. The intercept at 0 degrees C may fall outside the sampled range.
Wood buildings have an estimated 6 kWh higher mean use than brick buildings at a fixed outdoor temperature. Both fitted lines increase by 2 kWh per degree C.
Three-question check
Changing the reference group changes:
For fitted y = 8 + 3x − 5I_B, the B line is: