wallyPlot {pec} | R Documentation |
Wally plots to assess calibration of a risk or survival prediction
wallyPlot(object, time, formula, data, cause = 1, q = 10, ylim, hanging = FALSE, seed = NULL, mar = c(4.1, 4.1, 2, 2), colbox = "red", type = "risk", pseudo = FALSE, verbose = TRUE, ...)
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. |
type |
For survival models only: show either "risk" or "survival". |
pseudo |
Logical. Determines the method for estimating expected event frequencies. See |
verbose |
If |
... |
Further arguments passed to |
List of simulated and real data.
Paul F. Blanche <paul.blanche@univ-ubs.fr> and Thomas A. Gerds <tag@biostat.ku.dk>
calPlot
# Survival setting library(prodlim) library(survival) set.seed(180) d = SimSurv(180) f = coxph(Surv(time,status)~X1+X2,data=d) ## Not run: wallyPlot(f, time=4, q=10, type="risk", data=d, formula=Surv(time,status)~1) wallyPlot(f, time=4, q=10, hanging=TRUE, type="survival", 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)