Description Usage Arguments Details Value Author(s)
Extract event probabilities from fitted regression models and machine learning objects.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## S3 method for class 'glm'
predictRisk(object,newdata,...)
## S3 method for class 'cph'
predictRisk(object,newdata,times,...)
## S3 method for class 'coxph'
predictRisk(object,newdata,times,...)
## S3 method for class 'matrix'
predictRisk(object,newdata,times,cause,...)
## S3 method for class 'survfit'
predictRisk(object,newdata,times,...)
## S3 method for class 'prodlim'
predictRisk(object,newdata,times,cause,...)
## S3 method for class 'CauseSpecificCox'
predictRisk(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. |
... |
Additional arguments that are passed on to the current method. |
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. |
The function predictRisk is a generic function, meaning that it invokes specifically designed functions depending on the 'class' of the first argument.
See predictRisk
.
In uncensored binary outcome data there is no need to choose a time point.
When operating on models for survival analysis (without competing risks) the function still predicts the risk, as 1 - S(t|X) where S(t|X) is survival chance of a subject characterized by X.
When there are competing risks (and the data are right censored) one needs to specify both the time horizon for prediction (can be a vector) and the cause of the event. The function then extracts the absolute risks F_c(t|X) aka the cumulative incidence of an event of type/cause c until time t for a subject characterized by X. Depending on the model it may or not be possible to predict the risk of all causes in a competing risks setting. For example. a cause-specific Cox (CSC) object allows to predict both cases whereas a Fine-Gray regression model (FGR) is specific to one of the causes.
For binary outcome a vector with predicted risks. For survival outcome with and without
competing risks
a matrix with as many rows as NROW(newdata)
and as many
columns as length(times)
. Each entry is a probability and in
rows the values should be increasing.
Thomas A. Gerds tag@biostat.ku.dk
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.