7.2 Symmetry of the linear interaction
Interactions are symmetric. If the effect of depends on , then the effect of also depends on . This symmetry has important consequences for interpretation and visualization.
7.2.1 The symmetry
The linear interaction model is:
The slope of is:
And the slope of is:
The same interaction term appears in both. The interaction is symmetric: it is equally true that "the effect of depends on " and "the effect of depends on ."
# Demonstrate the symmetry of interactions
set.seed(42)
n <- 200
study <- runif(n, 0, 10)
sleep <- runif(n, 4, 9)
score <- 50 + 3 * study + 2 * sleep + 0.5 * study * sleep + rnorm(n, sd = 5)
m_int <- lm(score ~ study * sleep)
bx <- coef(m_int)[2]
bz <- coef(m_int)[3]
bxz <- coef(m_int)[4]
cat("Interaction model:\n")
cat(" beta_study:", round(bx, 3), "\n")
cat(" beta_sleep:", round(bz, 3), "\n")
cat(" beta_study:sleep:", round(bxz, 3), "\n")
cat("\nSlope of study at sleep = 4:", round(bx + bxz _ 4, 3), "\n")
cat("Slope of study at sleep = 6:", round(bx + bxz _ 6, 3), "\n")
cat("Slope of study at sleep = 8:", round(bx + bxz * 8, 3), "\n")
cat("\nSlope of sleep at study = 0:", round(bz + bxz _ 0, 3), "\n")
cat("Slope of sleep at study = 5:", round(bz + bxz _ 5, 3), "\n")
cat("Slope of sleep at study = 10:", round(bz + bxz * 10, 3), "\n")
cat("\nThe interaction is symmetric:\n")
cat(" Effect of study depends on sleep\n")
cat(" Effect of sleep depends on study\n")
cat(" Same coefficient (beta_xz) governs both\n")7.2.2 Visualizing the symmetry
We can visualize the interaction from either perspective: plot the effect of at different values of , or plot the effect of at different values of . Both show the same interaction.
# Visualize the symmetry of interactions
set.seed(42)
n <- 200
study <- runif(n, 0, 10)
sleep <- runif(n, 4, 9)
score <- 50 + 3 * study + 2 * sleep + 0.5 * study * sleep + rnorm(n, sd = 5)
m_int <- lm(score ~ study * sleep)
par(mfrow = c(1, 2))
# Left: effect of study at different sleep levels
study_seq <- seq(0, 10, length.out = 100)
colors <- c("firebrick", "steelblue", "darkgreen")
sleep_vals <- c(4, 6, 8)
plot(NULL, xlim = c(0, 10), ylim = c(40, 130),
xlab = "Study hours", ylab = "Score",
main = "Effect of study at different sleep levels")
for (i in 1:3) {
pred <- coef(m*int)[1] + coef(m_int)[2] * study*seq +
coef(m_int)[3] * sleep*vals[i] +
coef(m_int)[4] * study*seq * sleep_vals[i]
lines(study_seq, pred, lwd = 2, col = colors[i])
}
legend("topleft", legend = paste("Sleep =", sleep_vals), col = colors, lwd = 2)
# Right: effect of sleep at different study levels
sleep_seq <- seq(4, 9, length.out = 100)
study_vals <- c(0, 5, 10)
plot(NULL, xlim = c(4, 9), ylim = c(40, 130),
xlab = "Sleep hours", ylab = "Score",
main = "Effect of sleep at different study levels")
for (i in 1:3) {
pred <- coef(m*int)[1] + coef(m_int)[2] * study*vals[i] +
coef(m_int)[3] * sleep*seq +
coef(m_int)[4] * study*vals[i] * sleep_seq
lines(sleep_seq, pred, lwd = 2, col = colors[i])
}
legend("topleft", legend = paste("Study =", study_vals), col = colors, lwd = 2)
par(mfrow = c(1, 1))The symmetry is not a choice — it is a mathematical fact. The interaction term is the same as . There is no "moderator" and "moderated" variable — both moderate each other equally. When we say "the effect of depends on ," we are also saying "the effect of depends on ." The choice of which variable to plot on the x-axis is a presentation choice, not a statistical one. Both perspectives show the same interaction.
Summary of Section 7.2
- Interactions are symmetric: the effect of depends on and vice versa.
- The same coefficient governs both perspectives.
- The slope of is ; the slope of is .
- Visualizing from either perspective shows the same interaction.
- There is no "moderator" vs "moderated" — both moderate each other.