Skip to contents

Wrapper that computes cumulative incidences at multiple timepoints. Calls compute_psi_bar_t0() internally for each timepoint. Models are fitted once before calling this function to allow efficient evaluation at multiple timepoints without refitting.

Usage

compute_psi_bar_times(
  fit_0,
  fit_1,
  exposure_time,
  eval_times,
  tau,
  newdata,
  gp_list
)

Arguments

fit_0

A fitted model returned from fit_model_0()

fit_1

A fitted model returned from fit_model_1()

exposure_time

Name of the time-to-exposure variable in newdata. Used to compute \(\psi_0(t_0; d,x)\) where \(d + \tau\) and \(d + t_0\) are needed.

tau

Delay period

newdata

New data at which to do predictions.

Value

A matrix of estimates where the columns are the terms cuminc_0 and cuminc_1, and the rows are the time points of interest.

Details

This function expects models already fitted via fit_model_0() and fit_model_1(). It performs G-computation by predicting and marginalizing over conditional risks.