if (require("glmmTMB") && require("lme4")
## &&
## make sure package versions are OK
## checkDepPackageVersion(dep_pkg = "TMB",
## this_pkg = "glmmTMB",
## warn = FALSE) &&
## checkDepPackageVersion(dep_pkg = "Matrix",
## this_pkg = "TMB",
## warn = FALSE)
)
{
data("sleepstudy",package="lme4")
## original model:
if (FALSE) {
lmm1 <- glmmTMB(Reaction ~ Days + (Days | Subject), sleepstudy)
}
## load stored object
L <- load(system.file("extdata","glmmTMB_example.rda",package="broom.mixed"))
for (obj in L) {
assign(obj, glmmTMB::up2date(get(obj)))
}
tidy(lmm1)
tidy(lmm1, effects = "fixed")
tidy(lmm1, effects = "fixed", conf.int=TRUE)
tidy(lmm1, effects = "fixed", conf.int=TRUE, conf.method="uniroot")
## FIX: tidy(lmm1, effects = "ran_vals", conf.int=TRUE)
head(augment(lmm1, sleepstudy))
glance(lmm1)
## original model:
## glmm1 <- glmmTMB(incidence/size ~ period + (1 | herd),
## data = cbpp, family = binomial, weights=size)
tidy(glmm1)
tidy(glmm1, effects = "fixed")
tidy(glmm1, effects = "fixed", exponentiate=TRUE)
tidy(glmm1, effects = "fixed", conf.int=TRUE, exponentiate=TRUE)
head(augment(glmm1, cbpp))
head(augment(glmm1, cbpp, type.residuals="pearson"))
glance(glmm1)
if (FALSE) {
## profile CIs - a little bit slower but more accurate
tidy(glmm1, effects = "fixed", conf.int=TRUE, exponentiate=TRUE, conf.method="profile")
}
}
Run the code above in your browser using DataLab