Estimate conditional survival function nuisance parameters using survival stacking
Source:R/prebuilt_generators.R
generate_nuisance_predictions_stackG.RdEstimate conditional survival function nuisance parameters using survival stacking
Usage
generate_nuisance_predictions_stackG(
time,
event,
X,
X_holdout,
newtimes,
SL.library = c("SL.mean", "SL.glm", "SL.earth", "SL.gam", "SL.ranger"),
V = 5,
bin_size = 0.05,
approx_times
)Arguments
- time
n x 1numeric vector of observed follow-up times. If there is censoring, these are the minimum of the event and censoring times.- event
n x 1numeric vector of status indicators of whether an event was observed.- X
n x pdata.frame of observed covariate values- X_holdout
m x pdata.frame of new observed covariate values at which to obtainmpredictions for the estimated algorithm. Must have the same names and structure asX.- newtimes
k x 1numeric vector of times at which to obtainkpredicted conditional survivals.- SL.library
Super Learner library
- V
Number of cross-validation folds, to be passed to
SuperLearner- bin_size
Size of time bin on which to discretize for estimation of cumulative probability functions. Can be a number between 0 and 1, indicating the size of quantile grid (e.g.
0.1estimates the cumulative probability functions on a grid based on deciles of observedtimes). IfNULL, creates a grid of all observedtimes. See stackG documentation.- approx_times
Numeric vector of times at which to approximate product integral or cumulative hazard interval. See stackG documentation.
Value
A list containing elements S_hat (conditional event survival function, corresponding to X_holdout and newtimes),
S_hat_train (conditional event survival function, corresponding to X and newtimes),
G_hat (conditional censoring survival function, corresponding to X_holdout and newtimes),
and G_hat_train (conditional censoring survival function, corresponding to X and newtimes)