NelsonAalen {ePCR} | R Documentation |
Cox-Oakes extension of the Nelson-Aalen estimates for a Cox model
Description
Implementing the heuristic Cox and Oakes extension of the Nelson-Aalen estimate for Cox model to extract individual-specific survival. Time-to-event predictions are then given at the first time point at which an individual reaches an event probability of 50
Usage
NelsonAalen(
b,
Xold,
Xnew,
events,
time,
tpred = 0:round(max(time, na.rm = T), 0),
plot = FALSE
)
Arguments
b |
Beta coefficients at optimal glmnet coxnet model (lambda, alpha) |
Xold |
Data matrix with rows as individuals (i.e. training data) |
Xnew |
Possible new prediction data matrix (if omitted the training data is used, or if it is a new dataset the columns should comform to the training data and new individuals be provided as rows) |
events |
Deaths or right-censoring per each individual (1 death 0 alive censored) for Xold |
time |
Times to event or censoring for Xold |
tpred |
The predicted time points; more tight grid gives a smoother curve |
plot |
Should an individualized plot be plotted to show how the cumulative survival curves behave |
Value
Predicted times-to-event predictions either for the training data or an optional provided novel dataset
Note
See section 3.6 at http://data.princeton.edu/pop509/NonParametricSurvival.pdf for the reference
Author(s)
Teemu Daniel Laajala teelaa@utu.fi
Examples
data(TYKSSIMU)
library(survival)
xdat <- as.matrix(xMEDISIMU)
ydat <- yMEDISIMU[,"surv"]