Estimate conditional survival function nuisance parameters using survival stacking
Source:R/prebuilt_generators.R
generate_nuisance_predictions_stackG.Rd
Estimate 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 1
numeric vector of observed follow-up times. If there is censoring, these are the minimum of the event and censoring times.- event
n x 1
numeric vector of status indicators of whether an event was observed.- X
n x p
data.frame of observed covariate values- X_holdout
m x p
data.frame of new observed covariate values at which to obtainm
predictions for the estimated algorithm. Must have the same names and structure asX
.- newtimes
k x 1
numeric vector of times at which to obtaink
predicted 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.1
estimates the cumulative probability functions on a grid based on deciles of observedtime
s). IfNULL
, creates a grid of all observedtime
s. 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
)