Learn R Programming

pec (version 1.0.7)

predictSurvProb: Predicting survival probabilities

Description

Function to extract survival probability predictions from various modeling approaches. The most prominent one is the Cox regression model which can be fitted for example with `coxph' and with `cph'. The function predictSurvProb is a generic function that means it invokes specifically designed functions depending on the 'class' of the first argument.

Usage

predictSurvProb(object, newdata, times, ...)
## S3 method for class 'aalen':
predictSurvProb(object, newdata, times,...)
## S3 method for class 'cox.aalen':
predictSurvProb(object, newdata, times,...)
## S3 method for class 'coxph':
predictSurvProb(object, newdata, times,...)
## S3 method for class 'cph':
predictSurvProb(object, newdata, times,...)
## S3 method for class 'default':
predictSurvProb(object, newdata, times,...)
## S3 method for class 'glm':
predictSurvProb(object, newdata, times,...)
## S3 method for class 'matrix':
predictSurvProb(object, newdata, times,...)
## S3 method for class 'mfp':
predictSurvProb(object, newdata, times,...)
## S3 method for class 'prodlim':
predictSurvProb(object, newdata, times,...)
## S3 method for class 'psm':
predictSurvProb(object, newdata, times,...)
## S3 method for class 'survfit':
predictSurvProb(object, newdata, times,...)
## S3 method for class 'phnnet':
predictSurvProb(object, newdata, times,train.data,...)
## S3 method for class 'survnnet':
predictSurvProb(object, newdata, times,train.data,...)
## S3 method for class 'rpart':
predictSurvProb(object, newdata, times,train.data,...)

Arguments

object
A model for which predicted probabilities are desired.
newdata
A data frame containing predictor variable combinations for which predictions are desired
times
A vector of times in the range of the response variable, e.g. times when the response is a survival object, at which the exceedance probabilities (i.e. the survival probabilities) are returned.
train.data
An optional data frame which contains the response and predictor variable combinations in which the prediction model was trained
...
Additional arguments that are passed on to the current method.

Value

  • A matrix with as many rows as NROW(newdata) and as many columns as length(times). Each entry should be a probability and in rows the values should be decreasing.

Details

The function pec requires survival probabilities for each row in newdata at requested times. These probabilities are extracted from a fitted model of class CLASS with the function predictSurvProb.CLASS. Currently there are predictSurvProb methods for objects of class cph (library Design), coxph (library survival), aalen (library timereg), cox.aalen (library timereg), mfp (library mfp), phnnet (library survnnet), survnnet (library survnnet), rpart (library rpart), product.limit (library prodlim), survfit (library survival), psm (library Design), glm (library stats).

See Also

predict,survfit