Description Usage Arguments Value Author(s) References Examples
##' Wally plots to assess calibration of a risk or survival prediction
1 2 3 4 |
object |
Probabilistic survival predictions or probabilistic event risk predictions
evaluated at |
time |
Time interest for evaluating calibration of the predictions. |
formula |
A survival or event history formula. The left hand
side is used to compute the expected event status. If
|
data |
A data frame in which to validate the prediction
models and to fit the censoring model. If |
cause |
For competing risks settings the cause of interest. |
q |
The number of quantiles. Defaults to 10. |
ylim |
Limits of y-axis. If missing the function tries to find appropriate limits based on the simulated and real data. |
hanging |
If |
seed |
A seed value to make results reproducible. |
mar |
Plot margins passed to par. |
colbox |
Color of the box which identifies the real data calibration plot. |
verbose |
If |
col |
Colour of the bars. |
xlab |
Label for x-axis |
labels |
Label below the bars. Either |
... |
Further arguments passed to the subroutine |
List of simulated and real data.
Paul F. Blanche <paulfblanche@gmail.com> and Thomas A. Gerds <tag@biostat.ku.dk>
Blanche P, Gerds T A, Ekstrom C T (2017). The Wally plot approach to assess the calibration of clinical prediction models, submitted.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | # Survival setting
library(prodlim)
library(survival)
set.seed(180)
d = SimSurv(180)
f = coxph(Surv(time,status)~X1+X2,data=d,x=TRUE)
## Not run:
wallyPlot(f,
time=4,
q=10,
data=d,
formula=Surv(time,status)~1)
wallyPlot(f,
time=4,
q=10,
hanging=TRUE,
data=d,
formula=Surv(time,status)~1)
## End(Not run)
# Competing risks setting
library(prodlim)
library(survival)
library(riskRegression)
set.seed(180)
d2 = SimCompRisk(180)
f2 = CSC(Hist(time,event)~X1+X2,data=d2)
## Not run:
wallyPlot(f2,
time=5,
q=3,
hanging=TRUE,
data=d2,
formula=Hist(time,event)~1)
## End(Not run)
# Reproduce Wally plots presented in Blanche et al. (2017)
## Not run:
data(threecity)
wallyPlot(threecity$pi,
time=5,
hanging=TRUE,
formula=Hist(time,status)~1,
data=threecity,
ylim=c(-.1,.25),
seed= 511,
hline.lwd=3,
mar=c(1.01, 4.1, 1.15, 2))
## End(Not run)
## Not run:
data(divat)
wallyPlot(divat$pi,
time=5,
hanging=TRUE,
formula=Hist(time,status)~1,
data=divat,
ylim=c(-.1,.60),
seed= 123459,
hline.lwd=3,
mar=c(1.01, 4.1, 1.15, 2))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.