Skip to contents

ipcwmodel objects contain the fitted model, models fitted on jackknife samples, the prediction function, training Brier score, and metadata about the model.

Usage

ipcwmodel(
  model_name,
  full_model,
  jackknife_models,
  tau,
  predict,
  train_brier,
  time_var,
  status_var,
  training_vars,
  w,
  additional_information = list()
)

# S3 method for class 'ipcwmodel'
predict(object, newdata, naive = FALSE, z = 1.96, ...)

Arguments

model_name

Character. The name of the model.

full_model

The fitted model object for the full dataset.

jackknife_models

List of fitted models, each omitting one observation (the jackknife resamples).

tau

Numeric. The time horizon at which survival is estimated.

predict

Function. The prediction function for the fitted model.

train_brier

Numeric. The Brier score for the fitted model on the training data.

time_var

Character. The name of the time variable in the data.

status_var

Character. The name of the status variable in the data.

training_vars

Character vector. The names of the covariates used for model fitting.

w

Numeric vector. The IPCW weights used for model fitting.

additional_information

List. Additional information to be stored in the model object (default is an empty list).

object

An object of class ipcwmodel.

newdata

A data frame containing the covariates for which predictions are to be made.

naive

Logical. If TRUE, use the naive jackknife variance estimator. If False, use the IPCW-weighted estimator.

z

Numeric. The z-score to use for the confidence interval. Default is 1.96, corresponding to a 95% confidence interval.

...

Additional arguments (currently ignored).

Value

An object of class ipcwmodel containing the model details.

Details

Models can be used by calling the predict(model, newdata) method. It returns a data frame with columns for the prediction prediction, lower lower and upper upper Wald confidence intervals, and standard error se. The function can also take an optional argument z for the z-score used in confidence interval calculation.

The confidence intervals and standard errors can be computed using either the naive approach (using the number of jackknife models minus one as the denominator) or the robust approach (using the IPCW weights). This is controlled by the naive argument in the predict method. The Wald confidence intervals are calculated on the logit scale. See IPCWJK for more information.

Methods (by generic)

  • predict(ipcwmodel): Predict method for ipcwmodel objects.