Unpacking Interactions

An evolving tutorial on “unpacking” interactions.

Andy Grogan-Kaylor https://agrogan1.github.io/ (University of Michigan)https://www.umich.edu
2023-01-17
Show code
Show code
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()