Main vs interaction effects
\(y\): body mass (g)
\(x_1\): bill length
\(x_2\): island Dream
\(x_3\): island Torgersen
\[ \hat{y} = \hat{\beta_0} + \hat{\beta_1} x_1 + \hat{\beta_2} x_2 + \hat{\beta_3} x_3 \]
Bill length only impacts body mass via the term \(\beta_1 x_1\). \(x_2\) and \(x_3\) can be thought of as turning on or off a constant.
Main
Interaction
\[ \hat{y} = \hat{\beta_0} + \hat{\beta_1} x_1 + \hat{\beta_2} x_2 + \hat{\beta_3} x_3 + \hat{\beta_4} x_1 x_2 + \hat{\beta_5} x_1 x_3 \]
What’s different? The interaction terms (\(\beta_4 x_1 x_2\) and \(\beta_5 x_1 x_3\)).
Interpreting interactions can be difficult, especially without writing things down. To make it easier, we will compare the implied linear models:
Plug in 0 for islandDream
(\(x_2\)) and 0 for islandTorgersen
(\(x_3\)) to get the linear model for islandBiscoe
penguins
Plug in 1 for islandDream
(\(x_2\)) and 0 for islandTorgersen
(\(x_3\)) to get the linear model for islandDream
penguins
Plug in 0 for islandDream
(\(x_2\)) and 1 for islandTorgersen
(\(x_3\)) to get the linear model for islandTorgersen
penguins
- Biscoe fitted model:
\[ \hat{y} = -1726.0+ 142.3 x_1 \]
- Dream fitted model:
\[ \hat{y} = -1726.0 + 142.3 x_1 + 4478.7 -120.6 x_1 \]
Combine terms:
\[ \hat{y} = 2752.7 + 21.7 x_1 \]
Exercise 1
Write out the fitted model for Torgersen island below.
- Torgersen model: \[ \hat{y} = [\text{write here}] \]