buildmertree {buildmer} | R Documentation |
Use buildmer
to perform stepwise elimination for lmertree
and glmertree
models from package glmertree
Description
Use buildmer
to perform stepwise elimination for lmertree
and glmertree
models from package glmertree
Usage
buildmertree(
formula,
data = NULL,
family = gaussian(),
buildmerControl = buildmerControl(crit = "AIC")
)
Arguments
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 |
Details
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.
See Also
Examples
if (requireNamespace('glmertree')) {
model <- buildmertree(Reaction ~ 1 | (Days|Subject) | Days,
buildmerControl=buildmerControl(crit='LL',direction='order',args=list(joint=FALSE)),
data=lme4::sleepstudy)
model <- buildmertree(Reaction ~ 1 | (Days|Subject) | Days,
buildmerControl=buildmerControl(crit='LL',direction='order',args=list(joint=FALSE)),
data=lme4::sleepstudy,family=Gamma(link=identity))
}