Learn R Programming

riskRegression (version 2023.12.21)

predict.FGR: Predict subject specific risks (cumulative incidence) based on Fine-Gray regression model

Description

Predict subject specific risks (cumulative incidence) based on Fine-Gray regression model

Usage

# S3 method for FGR
predict(object, newdata, times, ...)

Arguments

object

Result of call to FGR

newdata

Predictor values of subjects for who to predict risks

times

Time points at which to evaluate the risks

...

passed to predict.crr

Examples

Run this code
library(prodlim)
library(survival)
set.seed(10)
d <- sampleData(101, outcome = "competing.risk")
tFun<-function(t) {t}
fgr<-FGR(Hist(time, event)~X1+strata(X2)+X6+cov2(X7, tf=tFun),
         data=d, cause=1)
predictRisk(fgr,times=5,newdata=d[1:10])

Run the code above in your browser using DataLab