Penalized mediation and outcome models
An auxiliary function which conducts variable selection of X for Y using penAFT, X for M using the selected penalized model and M for Y using penAFT.
StepOne(X, M, time, status, model_option = "MCP")
X
: An n by p matrix of exposures.M
: An n by p matrix of mediators.time
: A vector of survival time of samples.status
: A vector of status indicator: 0=alive, 1=dead.model_option
: The penalization method used when selecting X for M. The options include MCP, elastic net and lasso. Default is MCP.A list with the following components: - X_sel_Y_s1: X selected for Y using penAFT
M_X_s1: X selected for M using the selected penalized model
M_sel_Y_s1: M selected for Y using penAFT
data(example_dat) surv_dat <- example_dat$surv_dat res_step1 <- StepOne(X = example_dat$X, M = example_dat$M, time = surv_dat$time, status = surv_dat$status, model_option = "MCP")
Useful links