Plotting the predictions of a mixed model as a line in R
问题 I'm trying to plot the predictions ( predict() ) of my mixed model below such that I can obtain my conceptually desired plot as a line below. I have tried to plot my model's predictions, but I don't achieve my desired plot. Is there a better way to define predict() so I can achieve my desired plot? library(lme4) dat3 <- read.csv('https://raw.githubusercontent.com/rnorouzian/e/master/dat3.csv') m4 <- lmer(math~pc1+pc2+discon+(pc1+pc2+discon|id), data=dat3) newdata <- with(dat3, expand.grid(pc1