I am having trouble generating a confidence interval that I was asked to when is a GLMM
Normally if it were not binomial would do for example like this:
library(boot)
library(lme4)
library(dplyr)
dat <- data.frame(x = runif(100, -2,2),ind = gl(n = 10, k = 10))
dat$y <- 1 + 2 * dat$x + rnorm(10, 0, 1.2)[dat$ind] + rnorm(100, 0, 0.5)
m <- lmer(y ~ x + (1|ind), dat)
b_par <- bootMer(x = m, FUN = fixef, nsim = 200)
boot.ci(b_par, type = "perc", index = 1)
But when y is binomial, I do not know how to generate the dat $ y mentioned above.
Thank you