surv_fl_grf.Rd
Estimating conditional average treatment effects (CATEs) for survival outcomes using M-learner with random (survival) forest predictive models (implemented via the grf 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.
Remark: A random survival forest model is used for estimating nuisance parameters (i.e., inverse-probability-censoring weights), and a regression forest model is ued for estimating the target parameter CATEs
surv_fl_grf(
X,
Y,
W,
D,
t0,
W.hat = NULL,
cen.fit = "Kaplan-Meier",
k.folds = 10,
args.grf.nuisance = list()
)
The baseline covariates
The follow-up time
The treatment variable (0 or 1)
The event indicator
The prediction time of interest
The propensity score
The choice of model fitting for censoring
The number of folds for estimating nuisance parameters via cross-fitting
Input arguments for a grf model that estimates nuisance parameters
A surv_fl_grf object
# \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 <- 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.fl.grf.fit <- surv_fl_grf(X, Y, W, D, t0, W.hat = 0.5)
cate <- predict(surv.fl.grf.fit)
cate.test <- predict(surv.fl.grf.fit, X.test)
# }