[R-sig-ME] fitting glmer after using doFit=FALSE
Ben Bolker
bbolker at gmail.com
Wed Jun 5 16:56:36 CEST 2013
Samuel Bussmann <bussmann.1 at ...> writes:
> I have a question concerning the lme4 package -- specifically the
> glmer function. I am attempting to use doFit=FALSE to output and
> make edits to model matrices in order to accommodate a special form
> of the random effect. I can't seem to find out what function is used
> to fit the updated model matrices. I tried update and refit with
> no success. Any advice you could offer would be much appreciated.
Based on a look inside the lmer function, which has the following
snippet:
if (doFit) {
ans <- do.call(lmer_finalize, ans)
ans at call <- mc
}
It looks like this is what you want:
library("lme4.0") ## this is equivalent to CRAN-lme4
tmp <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy, doFit=FALSE)
ans <- do.call(lme4.0:::lmer_finalize, tmp)
I would also encourage you to try the development version
of lme4, which you can install from github:
library("devtools")
install_github("lme4","lme4")
It offers finer control of the details of the construction
and fitting process (help("modular"))
Ben Bolker
More information about the R-sig-mixed-models
mailing list