Course Outline
-
segmentGetting Started (Don't Skip This Part)
-
segmentStatistics and Data Science II
-
segmentPART I: EXPLORING AND MODELING VARIATION
-
segmentChapter 1 - Exploring Data with R
-
segmentChapter 2 - From Exploring to Modeling Variation
-
segmentChapter 3 - Modeling Relationships in Data
-
segmentPART II: COMPARING MODELS TO MAKE INFERENCES
-
segmentChapter 4 - The Logic of Inference
-
segmentChapter 5 - Model Comparison with F
-
segmentChapter 6 - Parameter Estimation and Confidence Intervals
-
segmentPART III: MULTIVARIATE MODELS
-
segmentChapter 7 - Introduction to Multivariate Models
-
segmentChapter 8 - Multivariate Model Comparisons
-
segmentChapter 9 - Models with Interactions
-
9.3 Representing the Interaction Model in GLM Notation
-
segmentChapter 10 - More Models with Interactions
-
segmentFinishing Up (Don't Skip This Part!)
-
segmentResources
list High School / Statistics and Data Science II (XCD)
9.3 Representing the Interaction Model in GLM Notation
The Interaction Model in GLM Notation
In the additive model, we constrain the slopes of the two regression lines to be the same, but allow the two lines to have different y-intercepts depending on condition
. We accomplish this by adding another term to the model that adjusts the y-intercept up or down if the patient is in the dog group (
Additive model:
In the interaction model, we allow the two lines to have different slopes (as well as different y-intercepts) depending on condition. To make the slope differ based on condition, we can add another term to the model that adjusts the slope when
Interaction model:
This new term, which includes the product of two variables (
Interaction model:
Writing Simple Expressions
We know that the model predictions for the interaction model can be represented as two straight lines, each with its own y-intercept and slope. But it is not always easy to see the two lines when they are embedded in the complete model.
One way to help us see the two lines in the complete model is to write a separate model statement for patients in each group: Control and Dog. We will call these simplified model statements simple expressions.
Here, again, is the complete interaction model:
Notice that
Let’s focus in on the simple expression for the control condition:
We can begin to summarize how to interpret the parameter estimates of the interaction model by filling in the first row of the table below.
condition | y-intercept | slope |
---|---|---|
Control |
|
|
Dog | – | – |
It stands to reason that if we look at the simple expression for the dog condition, we should be able to see that it too is an equation of a line (it would just have a different y-intercept and a different slope). Let’s delve into that:
Although these lm()
). That’s why we call them coefficients rather than variables. The only true variable here is
Here’s how we would re-write the simple expression for the dog condition:
Now we can fill in the rest of our table:
condition | y-intercept | slope |
---|---|---|
Control |
|
|
Dog |
|
|
These y-intercepts and slopes fit into the simple expressions like this:
Control group model:
Dog group model:
The Control
group, whereas the Control
group to that of the Dog
group.
The Control
group. Dog
group.