An evolving tutorial on “unpacking” interactions.
ggplot(data = NULL) +
xlim(0, 100) +
ylim(0, 100) +
geom_textabline(aes(intercept = 25,
slope = .5,
label = "reference line"),
color = "red") +
geom_textabline(aes(intercept = 25,
slope = .25,
label = "flatter slope; same intercept"),
color = "blue") +
geom_textabline(aes(intercept = 50,
slope = .25,
label = "flatter slope; higher intercept"),
color = "forestgreen") +
labs(title = "We cannot just consider the interaction.",
subtitle = "We also need to consider the intercept and slopes.",
x = "x (risk or protective factor)",
y = "y (outcome)") +
theme_minimal()