View source: R/predictLifeYearsLost.R
predictLifeYearsLost | R Documentation |
Function to extract predicted life years lost from various modeling
approaches. The most prominent one is the combination of cause-specific Cox
regression models which can be fitted with the function cumincCox
from the package compRisk
.
predictLifeYearsLost(object, newdata, times, cause, ...)
object |
A fitted model from which to extract predicted event probabilities |
newdata |
A data frame containing predictor variable combinations for which to compute predicted event probabilities. |
times |
A vector of times in the range of the response variable, for which the cumulative incidences event probabilities are computed. |
cause |
Identifies the cause of interest among the competing events. |
... |
Additional arguments that are passed on to the current method. |
The function predictLifeYearsLost is a generic function that means it invokes specifically designed functions depending on the 'class' of the first argument.
See predictSurvProb
.
A matrix with as many rows as NROW(newdata)
and as many
columns as length(times)
. Each entry should be a positive value and
in rows the values should be increasing.
Thomas A. Gerds tag@biostat.ku.dk
predictSurvProb
, predictEventProb
.
library(pec)
library(riskRegression)
library(survival)
library(prodlim)
train <- SimCompRisk(100)
test <- SimCompRisk(10)
fit <- CSC(Hist(time,cause)~X1+X2,data=train,cause=1)
predictLifeYearsLost(fit,newdata=test,times=seq(1:10),cv=FALSE,cause=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.