Learn R Programming

StratifiedMedicine (version 0.2.3)

submod_ctree: Subgroup Identification: Conditional Inference Trees (ctree)

Description

Uses the ctree (conditional inference trees through partykit R package) algorithm to identify subgroups (Hothorn, Hornik, Zeileis 2006). Usable for continuous, binary, or survival outcomes. Option to use the observed outcome or PLEs (i.e. individual treatment effect) for subgroup identification.

Usage

submod_ctree(Y, A, X, Xtest, mu_train, alpha = 0.05,
  minbucket = floor(dim(X)[1] * 0.1), maxdepth = 4,
  outcome_PLE = FALSE, family = "gaussian", ...)

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)

minbucket

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)

outcome_PLE

If TRUE, use PLE as outcome (mu_train must contain PLEs).

family

Outcome type ("gaussian", "binomial", "survival), default is "gaussian"

...

Any additional parameters, not currently passed through.

Value

Trained ctree model.

  • mod - ctree model object

References

Hothorn T, Hornik K, Zeileis A (2006). Unbiased Recursive Partitioning: A Conditional Inference Framework. Journal of Computational and Graphical Statistics, 15(3), 651<U+2013>674.

Examples

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

## Continuous ##
dat_ctns = generate_subgrp_data(family="gaussian")
Y = dat_ctns$Y
X = dat_ctns$X
A = dat_ctns$A

res_ctree1 = submod_ctree(Y, A, X, Xtest=X, family="gaussian")
res_ctree2 = submod_ctree(Y, A, X, Xtest=X, family="gaussian", maxdepth=2, minsize=100)
plot(res_ctree1$mod)
plot(res_ctree2$mod)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab