predict.FGR: Predict subject specific risks (cumulative incidence) based...

Description Usage Arguments Examples

View source: R/predict.FGR.R

Description

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

Usage

1
2
## S3 method for class '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

1
2
3
4
5
6
7
8
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])

Example output

Loading required package: data.table
Loading required package: ggplot2
Loading required package: prodlim
riskRegression version 2019.01.29
            [,1]
 [1,] 0.13299138
 [2,] 0.85169265
 [3,] 0.42770067
 [4,] 0.38976643
 [5,] 0.11350808
 [6,] 0.04557124
 [7,] 0.16149427
 [8,] 0.13046172
 [9,] 0.10263051
[10,] 0.20155413

riskRegression documentation built on Jan. 13, 2021, 11:12 a.m.