Bootstrapped confidence interval for GLMM model parameters

1

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

    
asked by anonymous 06.02.2018 / 15:08

1 answer

2

I've circled this way:

(gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
              data = cbpp, family = binomial))
b_par <- bootMer(x = gm1, FUN = fixef, nsim = 50)
boot::boot.ci(b_par, type = "perc", index = 1)

which is an example code of the function glmer and worked for binomial .

Try reducing the number of simulations (as I did here).

    
13.11.2018 / 12:39