View source: R/valProbSurvival.R
valProbSurvival | R Documentation |
Plot a calibration curve for a Cox Proportional Hazards model
valProbSurvival(
fit,
valdata,
alpha = 0.05,
timeHorizon = 5,
nk = 3,
plotCal = c("none", "base", "ggplot"),
addCox = FALSE,
addRCS = TRUE,
CL.cox = c("fill", "line"),
CL.rcs = c("fill", "line"),
xlab = "Predicted probability",
ylab = "Observed proportion",
xlim = c(-0.02, 1),
ylim = c(-0.15, 1),
lty.ideal = 1,
col.ideal = "red",
lwd.ideal = 1,
lty.cox = 1,
col.cox = "grey",
lwd.cox = 1,
fill.cox = "lightgrey",
lty.rcs = 1,
col.rcs = "black",
lwd.rcs = 1,
fill.rcs = rgb(177, 177, 177, 177, maxColorValue = 255),
riskdist = "predicted",
d0lab = "0",
d1lab = "1",
size.d01 = 5,
dist.label = 0.01,
line.bins = -0.05,
dist.label2 = 0.04,
length.seg = 0.85,
legendloc = c(0.5, 0.27)
)
fit |
the model fit, has to be of type |
valdata |
the validation data set |
alpha |
the significance level |
timeHorizon |
the time point at which the predictions have to be evaluated |
nk |
the number of knots, for the restricted cubic splines fit |
plotCal |
indicates if and how the calibration curve has to be plotted.
|
addCox |
logical, indicates if the Cox's estimated calibration curve has to be added to the plot |
addRCS |
logical, indicates if the restricted cubic splines' (RCS) estimated calibration curve has to be added to the plot |
CL.cox |
|
CL.rcs |
|
xlab |
x-axis label, default is |
ylab |
y-axis label, default is |
xlim , ylim |
numeric vectors of length 2, giving the x and y coordinates ranges (see |
lty.ideal |
linetype of the ideal line. Default is |
col.ideal |
controls the color of the ideal line on the plot. Default is |
lwd.ideal |
controls the line width of the ideal line on the plot. Default is |
lty.cox |
if |
col.cox |
if |
lwd.cox |
if |
fill.cox |
if |
lty.rcs |
if |
col.rcs |
if |
lwd.rcs |
if |
fill.rcs |
if |
riskdist |
Use |
d0lab , d1lab |
controls the labels for events and non-events (i.e. outcome y) for the histograms.
Defaults are |
size.d01 |
controls the size of the labels for events and non-events. Default is 5 and
this value is multiplied by 0.25 when |
dist.label |
controls the horizontal position of the labels for events and non-events. Default is 0.04. |
line.bins |
controls the horizontal (y-axis) position of the histograms. Default is -0.05. |
dist.label2 |
controls the vertical distance between the labels for events and non-events. Default is 0.03. |
length.seg |
controls the length of the histogram lines. Default is |
legendloc |
if |
An object of type SurvivalCalibrationCurves
with the following slots:
call |
the matched call. |
stats |
a list containing performance measures of calibration. |
alpha |
the significance level used. |
Calibration |
contains the estimated calibration slope, together with their confidence intervals. |
CalibrationCurves |
The coordinates for plotting the calibration curves. |
van Geloven N, Giardiello D, Bonneville E F, Teece L, Ramspek C L, van Smeden M et al. (2022). Validation of prediction models in the presence of competing risks: a guide through modern methods. BMJ, 377:e069249, doi:10.1136/bmj-2021-069249
## Not run:
library(CalibrationCurves)
data(trainDataSurvival)
data(testDataSurvival)
sFit = coxph(Surv(ryear, rfs) ~ csize + cnode + grade3, data = trainDataSurvival,
x = TRUE, y = TRUE)
calPerf = valProbSurvival(sFit, gbsg5, plotCal = "base", nk = 5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.