buildmertree {buildmer} | R Documentation |
buildmer
to perform stepwise elimination for lmertree()
and glmertree()
models from package glmertree
Use buildmer
to perform stepwise elimination for lmertree()
and glmertree()
models from package glmertree
buildmertree( formula, data = NULL, family = gaussian(), buildmerControl = buildmerControl(crit = "AIC"), ... )
formula |
Either a |
data |
See the general documentation under |
family |
See the general documentation under |
buildmerControl |
Control arguments for buildmer — see the general documentation under |
... |
Additional options to be passed to |
Note that the likelihood-ratio test is not available for glmertree
models, as it cannot be assured that the models being compared are nested. The default is thus to use AIC.
In the generalized case or when testing many partitioning variables, it is recommended to pass joint=FALSE
, as this results in a dramatic speed gain and reduces the odds of the final glmer
model failing to converge or converging singularly.
if (requireNamespace('glmertree')) { model <- buildmertree(Reaction ~ 1 | (Days|Subject) | Days, buildmerControl=buildmerControl(crit='LL',direction='order'), data=lme4::sleepstudy) model <- buildmertree(Reaction ~ 1 | (Days|Subject) | Days, buildmerControl=buildmerControl(crit='LL',direction='order'), data=lme4::sleepstudy,family=Gamma(link=identity),joint=FALSE) }