How to plot mixed-effects model estimates in ggplot2 in R?
I have a 2x2x2 factorial design with one random effect. The data (dat) is as follows: colour size level marbles set Blue Large Low 80 1 Blue Large High 9 2 Blue Small Low 91 1 Blue Small High 2 1 White Large Low 80 2 White Large High 9 1 White Small Low 91 2 White Small High 2 1 I want to plot two models: mod1 <- lmer(marbles ~ colour + size + level + colour:size + colour:level + size:level + (1|set), data = dat) mod2 <- lmer(marbles ~ colour + size + level +(1|set), data = dat) I usually use the following code to do my plots: pd <- position_dodge(0.82) ggplot(dat, aes(x=colour, y=marbles,