Given a readily fitted regularized Cox regression model, this function predicts the cumulative survival probabilities for new data at time points determined by the user. The function uses c060-package's functionality for computing base hazard, and then performs linear predictions for new observations using the fitted regularized Cox regression model.
TimeSurvProb(
fit,
time,
event,
olddata,
newdata,
s,
times = c(1:36) * 30.5,
plot = FALSE
)
Cumulative survival probabilities at the chosen time points
A single regularized Cox regression model fitted using glmnet
Time to events for the training data
Event indicators for the training data (0 censored, 1 event)
The old data matrix used to fit the original 'fit' glmnet-object
The new data matrix for which to predict time-to-event prediction (should comform to the old data matrix)
The optimal lambda parameter as used in the glmnet-package for its fit objects
The time points at which to estimate the cumulative survival probabilities (by default in days)
Should the cumulative survival probabilities be plotted as a function of time
Teemu Daniel Laajala teelaa@utu.fi