How to Illustrate Continuous-Continuous Interactions What is the best way to illustrate an effect modification from a general linear model?
I can use GraphPad Prism or R; can anyone point me resources showcasing how to produce publication ready plots for this purpose ?
 A: Typically, you calculate the conditioned glm equation for several levels of your moderator (e.g., mean - 1 sd, mean, and mean + 1 sd). This can then be plotted in a scatterplot.
I recommend using ggplot in R. To make it publication ready, you can use several themes, for instance, for APA there is a dedicated theme.
A: @Isabella' s answer is great! I wanted to add a ggplot alternative to plotting the interactions
library(effects)
library(tidyverse)

model <- lm(mpg ~ hp + disp*wt, data = mtcars)

effect.disp <-  predictorEffect("disp", model, xlevels=list(wt = c(2.5,3,3.5)))

# When turning the effect.disp object into a dataframe, we see
# that it has all the elements we want
# The "fit" is the predicted mpg
# The "lower" and "upper" are the uncertainty values we need for the ribbon

effect.disp %>% as.data.frame() %>% names()
#> [1] "disp"  "wt"    "fit"   "se"    "lower" "upper"

effect.disp %>% 
  as.data.frame() %>% 
  ggplot(aes(x = disp, y = fit))+
  geom_line()+
  geom_ribbon(aes(ymin = lower, ymax = upper), fill = "grey30", alpha = 0.2)+
  facet_wrap(~wt)+
  labs(y = "mpg")


# or if we want all lines in one plot
# [it's best if we turn the "wt" variable into a factor]


effect.disp %>% 
  as_tibble() %>% 
  ggplot(aes(x = disp, y = fit, group = factor(wt)))+
  geom_line(aes(colour = factor(wt)))+
  geom_ribbon(aes(ymin = lower, ymax = upper, fill = factor(wt)), 
              alpha = 0.2)+
  labs(y = "mpg")


Created on 2019-07-31 by the reprex package (v0.3.0)
