Interaction
Study guides: Exam PA, Exam MAS-I, Exam ACIA-CAPSTONE
An Interaction between two predictors is present when the effect of one predictor on the response depends on the value of the other. An interaction enters the linear predictor as a coefficient multiplied by the product of the two predictors, so with predictors x_1 and x_2 the linear predictor is
\eta = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_3 x_1 x_2
\beta_1and\beta_2are the main effects ofx_1andx_2.\beta_3is the interaction coefficient.
A unit increase in x_1 changes the linear predictor by \beta_1 + \beta_3 x_2, so the effect of x_1 depends on x_2. When \beta_3 = 0, the effects of the two predictors add on the scale of the linear predictor and there is no interaction. An interaction between a categorical predictor and a continuous one gives each level of the categorical predictor its own slope.
A Poisson frequency GLM has vehicle age
x_1, an indicatorx_2that is 1 for a sports car, and their interaction, with\hat_1 = -0.02,\hat_2 = 0.10and\hat_3 = 0.03. How does one more year of vehicle age change the linear predictor for a sports car and for any other car?
- For a car that is not a sports car,
x_2 = 0, so one more year changes\hat{\eta}by\hat{\beta}_1 = -0.02.- For a sports car,
x_2 = 1, so one more year changes\hat{\eta}by\hat{\beta}_1 + \hat{\beta}_3 = -0.02 + 0.03 = 0.01.- Frequency falls with vehicle age for other cars and rises slightly with vehicle age for sports cars.
Interaction of two binary predictors
When x_1 and x_2 are both indicators, the interaction term applies only when both are 1. Write \mu_{00}, \mu_{10}, \mu_{01} and \mu_{11} for the means of the four combinations, with the first subscript the value of x_1 and the second the value of x_2. With link function g, the interaction coefficient is
\beta_3 = g(\mu_{11}) - g(\mu_{10}) - g(\mu_{01}) + g(\mu_{00})
It is the amount the linear predictor of the combination exceeds the sum of the main effects. Under a log link, \beta_3 = 0 exactly when \mu_{11}\mu_{00} = \mu_{10}\mu_{01}, so a zero interaction means the effects multiply.
A model with an intercept, two indicators and their interaction gives fitted means
\mu_ = 0.20,\mu_ = 0.30,\mu_ = 0.40and\mu_ = 0.60. Under which of the identity, inverse and log links is the interaction coefficient non-zero?
- Under the identity link,
\beta_3 = 0.60 - 0.30 - 0.40 + 0.20 = 0.10.- Under the inverse link,
\beta_3 = \frac{1}{0.60} - \frac{1}{0.30} - \frac{1}{0.40} + \frac{1}{0.20} = 0.8333.- Under the log link,
\beta_3 = \ln\frac{0.60 \times 0.20}{0.30 \times 0.40} = \ln 1 = 0.- The interaction coefficient is non-zero under the identity and inverse links only.
Interaction of two categorical predictors
An interaction between a categorical predictor with k levels and one with m levels is coded by the products of their indicator variables. The number of interaction coefficients is
(k - 1)(m - 1)
The interaction coefficients are tested together, by comparing the models with and without them in a nested-model test based on the deviance. Each coefficient on its own depends on which levels are the base levels. A model that includes an interaction also includes the main effects of both predictors, even when their coefficients are not significant.
A frequency model has territory with 4 levels, vehicle type with 3 levels and their interaction. How many coefficients does the model have?
- The intercept is 1 coefficient.
- The main effects have
4 - 1 = 3and3 - 1 = 2coefficients.- The interaction has
(4 - 1)(3 - 1) = 6coefficients.- The model has
1 + 3 + 2 + 6 = 12coefficients, one for each of the4 \times 3 = 12combinations.
Cross-level interaction in a multilevel model
In a multilevel model, a group-level covariate can appear in the equation for the slope of an observation-level covariate. Substituting that equation into the observation-level equation produces the product of the two covariates, which is called a cross-level interaction.
Practice questions
- CAS Exam 8 Fall 2019, Question 6
- Exam ATPA Practice Question 44
- CAS Exam MAS-I Spring 2018, Question 37
- CAS Exam MAS-I Spring 2018, Question 39
- CAS Exam MAS-I Fall 2019, Question 26
- CAS Exam MAS-I Spring 2019, Question 33
- CAS Exam MAS-I Spring 2019, Question 38
- Exam MAS-I Practice Question 106
- Exam MAS-I Practice Question 109
- Exam MAS-I Practice Question 110
- Exam MAS-I Practice Question 153
- Exam MAS-I Practice Question 154
- Exam MAS-I Practice Question 168
- CAS Exam MAS-II Fall 2018, Question 12
- CAS Exam MAS-II Fall 2018, Question 32
- CAS Exam MAS-II Fall 2019, Question 11
- CAS Exam MAS-II Spring 2019, Question 1
- Exam PA Practice Question 25
- Exam PA Practice Question 26