ple_train: Patient-level Estimates: Train Model

Description Usage Arguments Value See Also Examples

View source: R/ple_train.R

Description

Wrapper function to train a patient-level estimate (ple) model. Used directly in PRISM and can be used to directly fit a ple model by name.

Usage

1
ple_train(Y, A, X, Xtest, family = "gaussian", ple, 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

family

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

ple

PLE (Patient-Level Estimate) function. Maps the observed data to PLEs. (Y,A,X) ==> PLE(X).

hyper

Hyper-parameters for the ple model (must be list). Default is NULL.

...

Any additional parameters, not currently passed through.

Value

Trained ple models and patient-level estimates for train/test sets. For family="gaussian" or "binomial", output estimates of (E(Y|X,A=1), E(Y|X,A=0), E(Y|X,A=1)-E(Y|X,A=0)). For survival, output estimates of (HR(X,A=1), HR(X,A=0), HR(X, A=1)-HR(X, A=0)) or (RMST(X,A=1), RMST(X,A=0), RMST(X, A=1)-RMST(X, A=0)).

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 ple_ranger directly (treatment-specific ranger models) #
mod1 = ple_ranger(Y, A, X, Xtest=X)
summary(mod1$mu_train)

# Fit through ple_train wrapper #
mod2 = ple_train(Y=Y, A=A, X=X, Xtest=X, ple="ple_ranger" )
summary(mod2$mu_train)

StratifiedMedicine documentation built on Dec. 12, 2019, 9:07 a.m.