Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predictEventProb

Predicting event probabilities (cumulative incidences) in competing risk models.


Description

Function to extract event probability predictions 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.

Usage

predictEventProb(object, newdata, times, cause, ...)

Arguments

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.

Details

The function predictEventProb is a generic function that means it invokes specifically designed functions depending on the 'class' of the first argument.

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 increasing.

Author(s)

Thomas A. Gerds tag@biostat.ku.dk

See Also

Examples

library(pec)
library(survival)
library(riskRegression)
library(prodlim)
train <- SimCompRisk(100)
test <- SimCompRisk(10)
cox.fit  <- CSC(Hist(time,cause)~X1+X2,data=train)
predictEventProb(cox.fit,newdata=test,times=seq(1:10),cause=1)

## with strata
cox.fit2  <- CSC(list(Hist(time,cause)~strata(X1)+X2,Hist(time,cause)~X1+X2),data=train)
predictEventProb(cox.fit2,newdata=test,times=seq(1:10),cause=1)

pec

Prediction Error Curves for Risk Prediction Models in Survival Analysis

v2020.11.17
GPL (>= 2)
Authors
Thomas A. Gerds
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.