## Not run:
#
# # basic usage
# require(optimx)
# gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
# data = cbpp, family = binomial)
# gm_all <- allFit(gm1)
# t(sapply(gm_all,fixef)) ## extract fixed effects
# sapply(gm_all,logLik) ## log-likelihoods
# sapply(gm_all,getME,"theta") ## theta parameters
# !sapply(gm_all,inherits,"try-error") ## was fit OK?
#
#
# ## use allFit in combination with expand.re = TRUE
# data("sk2011.2") # see example("mixed")
# sk2_aff <- droplevels(sk2011.2[sk2011.2$what == "affirmation",])
# sk_m2 <- mixed(response ~ instruction*inference*type+(inference*type||id), sk2_aff,
# expand_re = TRUE)
# sk_m2
# sk_m2_allFit <- allFit(sk_m2$full.model)
# sk_m2_allFit # all fits fail
#
# sk2_aff_b <- mixed(response ~ instruction*inference*type+(inference*type||id), sk2_aff,
# expand_re = TRUE, return = "data") # returns data only
# sk_m2_allFit <- allFit(sk_m2$full.model, data = sk2_aff_b) # works now
# t(sapply(sk_m2_allFit,fixef))
# sapply(sk_m2_allFit,logLik)
#
# ## End(Not run)
Run the code above in your browser using DataLab