Obtain estimated tau(X) using a trained T-learner with Cox regression

# S3 method for surv_tl_coxph
predict(object, newdata = NULL, t0 = NULL, ...)

Arguments

object

An surv_tl_coxph object

newdata

Covariate matrix to make predictions on. If null, return the tau(X) predictions on the training data

t0

The prediction time of interest

...

Additional arguments (currently not used)

Value

A vector of estimated conditional average treatment effects

Details

Remark: CATE predictions can be made at any time point on the estimated survival curve

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 <- 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.tl.coxph.fit <- surv_tl_coxph(X, Y, W, D, t0)
cate <- predict(surv.tl.coxph.fit)
cate.test <- predict(surv.tl.coxph.fit, X.test)
# }