View source: R/predict.riskRegression.R
predict.riskRegression | R Documentation |
Extract predictions from a risk prediction model.
## S3 method for class 'riskRegression'
predict(object, newdata, ...)
object |
Fitted object obtained with one of |
newdata |
A data frame containing predictor variable combinations for which to compute predicted risk. |
... |
not used |
Thomas H. Scheike ts@biostat.ku.dk
Thomas A. Gerds tag@biostat.ku.dk
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
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,])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.