# NOT RUN {
if (require("lme4")) {
## original model
# }
# NOT RUN {
lmm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
# }
# NOT RUN {
## load stored object
load(system.file("extdata", "lme4_example.rda", package="broom.mixed"))
tidy(lmm1)
tidy(lmm1, effects = "fixed")
tidy(lmm1, effects = "fixed", conf.int=TRUE)
tidy(lmm1, effects = "fixed", conf.int=TRUE, conf.method="profile")
## lmm1_prof <- profile(lmm1) # generated by extdata/runexamples
tidy(lmm1, conf.int=TRUE, conf.method="profile", profile=lmm1_prof)
## conditional modes (group-level deviations from population-level estimate)
tidy(lmm1, effects = "ran_vals", conf.int=TRUE)
## coefficients (group-level estimates)
(rcoef1 <- tidy(lmm1, effects = "ran_coefs"))
## reconstitute standard coefficient-by-level table
if (require(tidyr)) {
spread(rcoef1,key=term,value=estimate)
}
head(augment(lmm1, sleepstudy))
glance(lmm1)
glmm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
data = cbpp, family = binomial)
tidy(glmm1)
tidy(glmm1,exponentiate=TRUE)
tidy(glmm1, effects = "fixed")
head(augment(glmm1, cbpp))
glance(glmm1)
startvec <- c(Asym = 200, xmid = 725, scal = 350)
nm1 <- nlmer(circumference ~ SSlogis(age, Asym, xmid, scal) ~ Asym|Tree,
Orange, start = startvec)
tidy(nm1)
tidy(nm1, effects = "fixed")
head(augment(nm1, Orange))
glance(nm1)
detach("package:lme4")
}
if (require("lmerTest")) {
lmm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
tidy(lmm1)
glance(lmm1)
detach("package:lmerTest") # clean up
}
# }
Run the code above in your browser using DataCamp Workspace