R2 {pec} | R Documentation |
Cumulating prediction error curves over time and a time-dependent $R^2$ like measure.
R2(object, who, what, times ,nullModel=1) crps(object, who, what, times, start)
object |
An object with estimated prediction error curves obtained with the function pec |
who |
Which models in object$models should be
considered. Default is all models for crps and all models except the
reference for R2 |
what |
Usually pred.error – if crossvalidation or bootstrap methods are used
then also the apparent.error and if replan=boot.632plus then
also the BootB0.error, the estimated overfit, and the NoInf.error
can be cumulated or compared to a reference prediction model. |
times |
Time points at which the summaries are shown. |
start |
Only for crps: the time point at which the cumulation is started |
nullModel |
Position of the model whose prediction error is used as the reference in the denominator when constructing $R^2$ |
The cumulative prediction error (continuous ranked probability score) is defined as the area under the prediction error curve.
In survival analysis the prediction error of the Kaplan-Meier estimator plays a similar role as the total sum of squares in linear regression. Hence, it is a sensible reference model for $R^2$.
A matrix with a column for every requested prediction model
Thomas A. Gerds tag@biostat.ku.dk
set.seed(18713) dat=SimSurv(100) nullmodel=prodlim(Hist(time,status)~1,data=dat) pmodel=coxph(Surv(time,status)~X1+X2,data=dat) perror=pec(list(KaplanMeier=nullmodel,Cox=pmodel),Hist(time,status)~1,data=dat) ## cumulative prediction error crps(perror,times=1) # between min time and 1 crps(perror,times=1,start=0) # between 0 and 1 crps(perror,times=seq(0,1,.2),start=0) # between 0 and seq(0,1,.2) R2(perror,times=seq(0,1,.1))