
Last chance! 50% off unlimited learning
Sale ends in
Retrospective table of risks predicted by two different methods, models, algorithms
reclass(object, reference, formula, data, time, cause, cuts = seq(0, 100, 25),
digits = 2)
Either a
list with two elements. Each element should either
be a vector with probabilities, or an object for which
predictSurvProb
or predictEventProb
can extract predicted risk based on data.
Reference prediction model.
A survival formula as obtained either with
prodlim::Hist
or survival::Surv
which defines the
response in the data
.
Used to extract the response from the data and passed
on to predictEventProb
to extract predicted event
probabilities.
Time interest for prediction.
For competing risk models the cause of interest. Defaults to all available causes.
Risk quantiles to group risks.
Number of digits to show for the predicted risks
reclassification tables: overall table and one conditional table for each cause and for subjects event free at time interest.
All risks are multiplied by 100 before
predictStatusProb
# 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),
"Cox.X1.X2"=coxph(Surv(time,status)~X1+X2,data=d))
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))
# }
Run the code above in your browser using DataLab