Description Usage Arguments Value Examples
Bootstrap confidence intervals for (g)lmer models.
1 | bootstrap_lmer(model, n, conf = 0.95, ...)
|
model |
(g)lmer model for confidence interval estimation. |
n |
Number of bootstrap iterations |
conf |
Size of confidence interval. 0.95 by default. |
... |
Other arguments passed to bootMer in lme4. |
A dataframe with confidence interval information.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #Fit model
library(lme4)
library(boot)
data(sleepstudy)
data(cbpp)
fm1 <- lmer(Reaction ~ Days + (1|Subject), sleepstudy)
#Calculate 95% CIs with parametric boostrap and 100 iterations
bootstrap_lmer(fm1, n = 100, conf = 0.95, type = "parametric")
#Do the same with glmer
gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
data = cbpp, family = binomial)
#Calculate 95% CIs with parametric boostrap and 100 iterations
bootstrap_lmer(gm1, n = 100, conf = 0.95, type = "parametric")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.