Estimating conditional average treatment effects (CATEs) for survival outcomes using S-learner with penalized regression models Lasso (implemented via the glmnet package). The CATE is defined as tau(X) = p(Y(1) > t0 | X = x) - p(Y(0) > t0 | X = x), where Y(1) and Y(0) are counterfactual survival times under the treated and controlled arms, respectively.

surv_sl_lasso(
  X,
  Y,
  W,
  D,
  t0,
  alpha = 1,
  k.folds = NULL,
  foldid = NULL,
  lambda = NULL,
  lambda.choice = "lambda.min",
  penalty.factor = NULL
)

Arguments

X

The baseline covariates

Y

The follow-up time

W

The treatment variable (0 or 1)

D

The event indicator

t0

The prediction time of interest

alpha

Mix tuning parameter for the elastic net

k.folds

Number of folds for cross validation

foldid

User-supplied foldid. Must have length equal to length(W). If provided, it overrides the k.folds option.

lambda

User-supplied lambda sequence for cross validation

lambda.choice

How to cross-validate; choose from "lambda.min" or "lambda.1se"

penalty.factor

User-supplied penalty factor, must be of length the same as number of features in X

Value

a surv_sl_lasso object

Examples

# \donttest{
n <- 1000; p <- 25
t0 <- 0.2
Y.max <- 2
X <- matrix(rnorm(n * p), n, p)
W <- rbinom(n, 1, 0.5)
numeratorT <- -log(runif(n))
T <- (numeratorT / exp(1 * X[ ,1, drop = FALSE] + (-0.5 - 1 * X[ ,2, drop = FALSE]) * W)) ^ 2
failure.time <- pmin(T, Y.max)
numeratorC <- -log(runif(n))
censor.time <- (numeratorC / (4 ^ 2)) ^ (1 / 2)
Y <- as.numeric(pmin(failure.time, censor.time))
D <- as.integer(failure.time <= censor.time)
n.test <- 500
X.test <- matrix(rnorm(n.test * p), n.test, p)

surv.sl.lasso.fit <- surv_sl_lasso(X, Y, W, D, t0)
cate <- predict(surv.sl.lasso.fit)
cate.test <- predict(surv.sl.lasso.fit, X.test)
# }