submod_lmtree: Subgroup Identification: Model-based partitioning (lmtree)

Description Usage Arguments Value References Examples

View source: R/submod_lmtree.R

Description

Uses the lmtree (model-based partitioning, OLS; through partykit R package) algorithm to identify subgroups (Zeileis, Hothorn, Hornik 2008). Usable for continuous and binary outcomes.

Usage

1
2
submod_lmtree(Y, A, X, Xtest, mu_train, alpha = 0.05,
  minsize = floor(dim(X)[1] * 0.1), maxdepth = 4, parm = NULL, ...)

Arguments

Y

The outcome variable. Must be numeric or survival (ex; Surv(time,cens) )

A

Treatment variable. (a=1,...A)

X

Covariate space.

Xtest

Test set

mu_train

Patient-level estimates (See PLE_models)

alpha

Significance level for variable selection (default=0.05)

minsize

Minimum number of observations in a tree node. Default = floor( dim(train)[1]*0.05 )

maxdepth

Maximum depth of any node in the tree (default=4)

parm

Model parameters included in parameter instability tests (default=NULL, all parameters)

...

Any additional parameters, not currently passed through.

Value

Trained lmtree model.

References

Zeileis A, Hothorn T, Hornik K (2008). Model-Based Recursive Partitioning. Journal of Computational and Graphical Statistics, 17(2), 492–514.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(StratifiedMedicine)

## Continuous ##
dat_ctns = generate_subgrp_data(family="gaussian")
Y = dat_ctns$Y
X = dat_ctns$X
A = dat_ctns$A
train = data.frame(Y, A, X)
# Outcome/treatment must be labeled as Y/A #

res_lmtree1 = submod_lmtree(Y, A, X, Xtest=X)
res_lmtree2 = submod_lmtree(Y, A, X, Xtest=X, maxdepth=2, minsize=100)
plot(res_lmtree1$mod)
plot(res_lmtree2$mod)

StratifiedMedicine documentation built on March 1, 2020, 9:07 a.m.