GrowthCurveDemo {glmertree}R Documentation

Artificial dataset for partitioning of linear growth curve models

Description

Artificial dataset to illustrate fitting of LMM trees with growth curve models the terminal nodes.

Usage

data("GrowthCurveDemo")

Format

A data frame containing 1250 repeated observations on 250 persons:

person

numeric. Indicator linking repeated measurements to persons.

time

factor. Indicator for timepoint.

y

numeric. Response variable.

x1

numeric. Potential partitioning variable.

x2

numeric. Potential partitioning variable.

x3

numeric. Potential partitioning variable.

x4

numeric. Potential partitioning variable.

x5

numeric. Potential partitioning variable.

x6

numeric. Potential partitioning variable.

x7

numeric. Potential partitioning variable.

x8

numeric. Potential partitioning variable.

x9

numeric. Potential partitioning variable.

x10

numeric. Potential partitioning variable.

x11

numeric. Potential partitioning variable.

x12

numeric. Potential partitioning variable.

x13

numeric. Potential partitioning variable.

x14

numeric. Potential partitioning variable.

x15

numeric. Potential partitioning variable.

x16

numeric. Potential partitioning variable.

x17

numeric. Potential partitioning variable.

x18

numeric. Potential partitioning variable.

x19

numeric. Potential partitioning variable.

x20

numeric. Potential partitioning variable.

x21

numeric. Potential partitioning variable.

x22

numeric. Potential partitioning variable.

x23

numeric. Potential partitioning variable.

x24

numeric. Potential partitioning variable.

x25

numeric. Potential partitioning variable.

x26

numeric. Potential partitioning variable.

x27

numeric. Potential partitioning variable.

x28

numeric. Potential partitioning variable.

Details

Data were generated so that x1, x2 and x3 are true partitioning variables, while x4 through x28 are noise variables.

See Also

lmertree, glmertree

Examples


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)



[Package glmertree version 0.1-3 Index]