submod_train: Subgroup Identification: Train Model

Description Usage Arguments Value See Also Examples

View source: R/submod_train.R

Description

Wrapper function to train a subgroup model (submod). Used directly in PRISM and can be used to directly fit a submod model by name.

Usage

1
2
submod_train(Y, A, X, Xtest, mu_train = NULL, family = "gaussian",
  submod, hyper = 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). Default=NULL

family

Outcome type ("gaussian", "binomial", "survival"). Default="gaussian".

submod

Subgroup identification (submod) function. Maps the observed data and/or PLEs to subgroups.

hyper

Hyper-parameters for submod (must be list). Default is NULL.

...

Any additional parameters, not currently passed through.

Value

Trained subgroup model and subgroup predictions/estimates for train/test sets.

See Also

PRISM

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

# Fit submod_lmtree directly #
mod1 = submod_lmtree(Y, A, X, Xtest=X)
plot(mod1$mod)

# Fit through submod_train wrapper #
mod2 = submod_train(Y=Y, A=A, X=X, Xtest=X, submod="submod_lmtree")
plot(mod2$fit$mod)

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