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

...

Additional options to be passed to lmertree or glmertree. (They will also be passed to (g)lmtree in so far as they're applicable. The single exception is the control argument, which is assumed to be meant only for (g)lmertree and not for (g)lmtree, and will not be passed on to (g)lmtree). For backward-compatibility reasons, will also accept buildmer control parameters, although those specified in buildmerControl will take precedence.

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

}

[Package buildmer version 1.9 Index]