View source: R/oop_calibrator.R
plot.calibrator | R Documentation |
Draws two types of plots:
a Kaplan-Meier plots of the observed survival (solid line) and the Cox model-predicted survival in each linear predictor score strata. The global calibration measures are presented in plot caption. The legend contains the number of observations assigned to each linear predictor score strata. The total numbers of observations and events are shown in the plot tag.
a list of plots of square errors averaged over unique time points, observations and unique values of the linear predictor score
## S3 method for class 'calibrator'
plot(
x,
type = c("strata", "squares"),
palette = NULL,
cust_theme = survminer::theme_survminer(),
KM_size = 0.5,
show_cox = TRUE,
cox_size = 0.5,
cox_linetype = "dashed",
color_seed = 1234,
signif_digits = 2,
show_reference = TRUE,
error_stat = c("none", "se", "2se", "95perc"),
...
)
x |
a calibrator object. |
type |
type of the plot or plots:
|
palette |
a vector of color names corresponding to the strata number. |
cust_theme |
custom ggplot theme. |
KM_size |
size of the Kaplan-Meier plot line, ignored
if |
show_cox |
logical, should the Cox model-predicted survival for
the strata be plotted? Ignored if |
cox_size |
size of the Cox survival plot line.
Ignored if |
cox_linetype |
type of the Cox survival plot line, dashed by default.
Ignored if |
color_seed |
seed for the random color generator, ignored if palette provided. |
signif_digits |
significant digits for rounding the calibration
statistics displayed in the plot caption. Ignored if |
show_reference |
logical, should averaged squared errors be displayed
for the reference (NULL model)? Defaults to TRUE. Used only if
|
error_stat |
error statistic to be presented as a ribbon, defaults
to none. Used only if |
... |
extra arguments passed to |
The Kaplan-Meier plot is generated with
ggsurvplot
.
a ggplot object or a list og ggplot objects.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.