mod.simul = lme4::glmer(formula = cbind(Longer, Total - Longer) ~ X + (1 | Subject),
family = binomial(link = "probit"), data = simul_data)
xplode.mod = xplode(model = mod.simul, name.cont = "X")
longData <- MixInterpolate(xplode.mod)
# use the interpolated dataset to plot model:
library(ggplot2)
ggplot(longData, aes(X, prediction, color = Subject)) +
geom_line() +
geom_point(data = simul_data, aes(X, Longer/Total))
Run the code above in your browser using DataLab