Learn R Programming

riskRegression (version 2023.12.21)

predict.riskRegression: Predict individual risk.

Description

Extract predictions from a risk prediction model.

Usage

# S3 method for riskRegression
predict(object, newdata, ...)

Arguments

object

Fitted object obtained with one of ARR, LRR, riskRegression.

newdata

A data frame containing predictor variable combinations for which to compute predicted risk.

...

not used

Author

Thomas H. Scheike ts@biostat.ku.dk

Thomas A. Gerds tag@biostat.ku.dk

References

Gerds, TA and Scheike, T and Andersen, PK (2011) Absolute risk regression for competing risks: interpretation, link functions and prediction Research report 11/8. Department of Biostatistics, University of Copenhagen

Examples

Run this code

data(Melanoma)
library(prodlim)
library(survival)

fit.tarr <- ARR(Hist(time,status)~age+invasion+strata(sex),data=Melanoma,cause=1)
predict(fit.tarr,newdata=data.frame(age=48,
                     invasion=factor("level.1",
                         levels=levels(Melanoma$invasion)),
                     sex=factor("Female",levels=levels(Melanoma$sex))))
predict(fit.tarr,newdata=data.frame(age=48,
                     invasion=factor("level.1",
                         levels=levels(Melanoma$invasion)),
                     sex=factor("Male",levels=levels(Melanoma$sex))))
predict(fit.tarr,newdata=data.frame(age=c(48,58,68),
                     invasion=factor("level.1",
                         levels=levels(Melanoma$invasion)),
                     sex=factor("Male",levels=levels(Melanoma$sex))))
predict(fit.tarr,newdata=Melanoma[1:4,])

Run the code above in your browser using DataLab