buildmertree: Use 'buildmer' to perform stepwise elimination for 'lmertree'...

buildmertreeR 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 glmertree formula, looking like dep ~ left | middle | right where the middle part is an lme4-style random-effects specification, or an ordinary formula (or buildmer term list thereof) specifying only the dependent variable and the fixed and random effects for the regression part. In the latter case, the additional argument partitioning must be specified as a one-sided formula containing the partitioning part of the model.

data

See the general documentation under buildmer-package

family

See the general documentation under buildmer-package

buildmerControl

Control arguments for buildmer — see the general documentation under buildmerControl

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

buildmer-package

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))

}

buildmer documentation built on Oct. 25, 2023, 9:08 a.m.