Learn R Programming

StratifiedMedicine (version 0.2.3)

submod_glmtree: Subgroup Identification: Model-based partitioning (glmtree)

Description

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

Usage

submod_glmtree(Y, A, X, Xtest, mu_train, glm.fam = binomial,
  link = "identity", alpha = 0.05, minsize = floor(dim(X)[1] * 0.1),
  maxdepth = 4, parm = NULL, ...)

Arguments

Y

The outcome variable. Must be numeric

A

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

X

Covariate space.

Xtest

Test set

mu_train

Patient-level estimates (See PLE_models)

glm.fam

Family for GLM; default=binomial

link

Link function for GLM; default="identity"

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.

  • mod - lmtree model object

References

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

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
library(StratifiedMedicine)

## Binomial ##
dat_bin = generate_subgrp_data(family="binomial")
Y = dat_bin$Y
X = dat_bin$X
A = dat_bin$A


res_glmtree1 = submod_glmtree(Y, A, X, Xtest=X)
res_glmtree2 = submod_glmtree(Y, A, X, Xtest=X, link="logit")
plot(res_glmtree1$mod)
plot(res_glmtree2$mod)
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab