GrowthCurveDemo {glmertree} | R Documentation |
Artificial dataset to illustrate fitting of LMM trees with growth curve models the terminal nodes.
data("GrowthCurveDemo")
A data frame containing 1250 repeated observations on 250 persons:
numeric. Indicator linking repeated measurements to persons.
factor. Indicator for timepoint.
numeric. Response variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
numeric. Potential partitioning variable.
Data were generated so that x1
, x2
and x3
are
true partitioning variables, while x4
through x28
are noise
variables.
data("GrowthCurveDemo", package = "glmertree") dim(GrowthCurveDemo) names(GrowthCurveDemo) ## Fit LMM tree, while estimating random intercept for time form <- formula(paste0("y ~ time | person | ", paste0("x", 1:28, collapse = " + "))) form lt.default <- lmertree(form, data = GrowthCurveDemo) plot(lt.default, which = "tree") ## yields too large tree VarCorr(lt.default) ## Account for measurement level of the partitioning variables: lt.cluster <- lmertree(form, cluster = person, data = GrowthCurveDemo) plot(lt.cluster, which = "tree") ## yields correct tree VarCorr(lt.cluster) ## yields slightly larger ranef variance ## Also estimate random slopes of time: form.s <- formula(paste0("y ~ time | ((1+time)|person) | ", paste0("x", 1:28, collapse = " + "))) form.s lt.s.cluster <- lmertree(form.s, cluster = person, data = GrowthCurveDemo) plot(lt.s.cluster, which = "tree") ## same tree as before VarCorr(lt.s.cluster)