plot.rtModCVCalibration: Plot 'rtModCVCalibration' object

View source: R/calibrate_cv.R

plot.rtModCVCalibrationR Documentation

Plot rtModCVCalibration object

Description

Plot Calibration plots and Brier score boxplots for rtModCVCalibration object

Usage

## S3 method for class 'rtModCVCalibration'
plot(
  x,
  what = c("calibration", "brier"),
  type = c("aggregate.all", "aggregate.by.resample"),
  bin.method = c("quantile", "equidistant"),
  filename = NULL,
  ...
)

Arguments

x

rtModCVCalibration object

what

Character: "calibration" or "brier"

type

Character: "aggregate.all" or "aggregate.by.resample"

bin.method

Character: "quantile" or "equidistant"

filename

Character: Path to save plot as pdf

...

Additional arguments

Details

For calibration plots, type = "aggregate.all" is likely the more informative one. It shows calibrations curves before and after calibration by aggregating across all outer test sets. The type = "aggregate.by.resample" option shows the calibration curves after calibration for each outer resample.

For Brier boxplots, type = "aggregate.all" shows 1 score per outer resample prior to calibration and multiple (equal n.resamples used in calibrate_cv) brier scores per outer resample after calibration. This is for diagnostic purposes mainly. For presentation, the type = "aggregate.by.resample" option shows the mean Brier score per outer resample prior to calibration and after calibration and makes more sense. The uncalibrated estimates could be resampled using the calibration model resamples to produce a more comparable boxplot of Brier scores when using the type = "aggregate.all" option, but that seems artifactual.

More options are certainly possibly, e.g. an "aggregate.none" that would show all calibration resamples for all outer ersamples, and can be added in the future if needed.

Value

plotly object

Author(s)

E.D. Gennatas


egenn/rtemis documentation built on Nov. 22, 2024, 4:12 a.m.