MaizePrepSTATS 250
Exam 3 · Lec 19

Categorical predictors and parallel lines

Decode reference groups and compare adjusted group means.

25 minDraft

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

Parallel-lines model
y^=β^0+β^1x+β^2IB\hat y=\hat\beta_0+\hat\beta_1x+\hat\beta_2I_B
Reference A: I_B = 0. Group B: I_B = 1.
Group equations
y^A=β^0+β^1x,y^B=(β^0+β^2)+β^1x\hat y_A=\hat\beta_0+\hat\beta_1x,\quad\hat y_B=(\hat\beta_0+\hat\beta_2)+\hat\beta_1x
The vertical difference is beta-hat_2 at every x.

Which procedure?

Quantitative response, group comparison adjusted for numeric x
Regression with indicator variables and x.
Only an unadjusted comparison of two independent group means
Two-sample t-test; its target differs from an adjusted comparison.
Worked example

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.00
  1. For brick buildings, fitted kWh = 10 + 2(temperature).

  2. For wood buildings, fitted kWh = 16 + 2(temperature).

  3. At 20 degrees C, fitted use is 50 kWh for brick and 56 kWh for wood.

  4. The wood coefficient compares mean use at the same temperature. The intercept at 0 degrees C may fall outside the sampled range.

Answer

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

1
Lec 19

With an intercept, a five-category factor needs how many indicators?

2
Lec 19

Changing the reference group changes:

3
Lec 19

For fitted y = 8 + 3x − 5I_B, the B line is:

MaizePrep is an independent study resource. It is not affiliated with, sponsored by, or endorsed by the University of Michigan. Course names and numbers are used only to describe which class the material covers. Every practice question is original, written in the style of the course.