Skip to contents

Fits an IPCW-weighted logistic regression for right-censored survival data.

Usage

ipcw_logistic_regression(data, tau, time_var = "t", status_var = "delta")

Arguments

data

A data frame containing the survival data. Must include columns for the observed time and event indicator.

tau

Numeric scalar. The time horizon at which the survival probability is to be estimated.

time_var

Character. The name of the variable in data representing the observed time to event or censoring. Default is "t".

status_var

Character. The name of the variable in data representing the event indicator (1 if event occurred, 0 if censored). Default is "delta".

Value

An object of class ipcwmodel.

Details

A logistic model is fitted to the full dataset. Jackknife refits are computed to derive jackknife-based standard errors. Training is performed using glm with a binomial distribution to account for the IPCW weights.

See also

ipcw_weights() for the underlying implementation of the weights and IPCWJK as well as (Jahn-Eimermacher et al. 2025) for more information.

Other IPCW models: ipcw_xgboost()

Examples

library(survival)
tau <- 100
df <- veteran[, c("time", "status", "trt")]
newdata <- data.frame(trt = c(1, 2))

fit <- ipcw_logistic_regression(df,
  tau = tau, time_var = "time",
  status_var = "status"
)
predict(fit, newdata)
#>   prediction     lower     upper         se
#> 1  0.4944833 0.3759158 0.6136746 0.06183589
#> 2  0.3329983 0.2281472 0.4574760 0.05939724