reclass {pec} | R Documentation |
Retrospective risk reclassification table
Description
Retrospective table of risks predicted by two different methods, models, algorithms
Usage
reclass(
object,
reference,
formula,
data,
time,
cause,
cuts = seq(0, 100, 25),
digits = 2
)
Arguments
object |
Either a
list with two elements. Each element should either
be a vector with probabilities, or an object for which
|
reference |
Reference prediction model. |
formula |
A survival formula as obtained either with
|
data |
Used to extract the response from the data and passed
on to |
time |
Time interest for prediction. |
cause |
For competing risk models the cause of interest. Defaults to all available causes. |
cuts |
Risk quantiles to group risks. |
digits |
Number of digits to show for the predicted risks |
Details
All risks are multiplied by 100 before
Value
reclassification tables: overall table and one conditional table for each cause and for subjects event free at time interest.
Author(s)
Thomas A. Gerds <tag@biostat.ku.dk>
See Also
predictStatusProb
Examples
## Not run:
library(survival)
set.seed(40)
d <- prodlim::SimSurv(400)
nd <- prodlim::SimSurv(400)
Models <- list("Cox.X2"=coxph(Surv(time,status)~X2,data=d,x=TRUE,y=TRUE),
"Cox.X1.X2"=coxph(Surv(time,status)~X1+X2,data=d,x=TRUE,y=TRUE))
rc <- reclass(Models,formula=Surv(time,status)~1,data=nd,time=5)
print(rc)
plot(rc)
set.seed(40)
library(riskRegression)
library(prodlim)
dcr <- prodlim::SimCompRisk(400)
ndcr <- prodlim::SimCompRisk(400)
crPred5 <- list("X2"=predictEventProb(CSC(Hist(time,event)~X2,data=dcr),newdata=ndcr,times=5),
"X1+X2"=predictEventProb(CSC(Hist(time,event)~X1+X2,data=dcr),newdata=ndcr,times=5))
rc <- reclass(crPred5,Hist(time,event)~1,data=ndcr,time=3)
print(rc)
reclass(crPred5,Hist(time,event)~1,data=ndcr,time=5,cuts=100*c(0,0.05,0.1,0.2,1))
## End(Not run)