plotSmoothCalibration: Plot the smooth calibration as detailed in Calster et al. "A...

Description Usage Arguments Details Value

View source: R/Plotting.R

Description

Plot the smooth calibration as detailed in Calster et al. "A calibration heirarchy for risk models was defined: from utopia to empirical data" (2016)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
plotSmoothCalibration(
  result,
  smooth = c("loess", "rcs"),
  span = 1,
  nKnots = 5,
  scatter = F,
  type = "test",
  bins = 20,
  zoom = c("none", "deciles", "data"),
  sample = T,
  fileName = NULL
)

Arguments

result

The result of running runPlp function. An object containing the model or location where the model is save, the data selection settings, the preprocessing and training settings as well as various performance measures obtained by the model.

smooth

options: 'loess' or 'rcs'

span

This specifies the width of span used for loess. This will allow for faster computing and lower memory usage.

nKnots

The number of knots to be used by the rcs evaluation. Default is 5

scatter

plot the decile calibrations as points on the graph. Default is False

type

Whether to use train or test data, default is test.

bins

The number of bins for the histogram. Default is 20.

zoom

Zoom in on the region containing the deciles or on the data. If not specified shows the entire space.

sample

If using loess then by default 20,000 patients will be sampled to save time

fileName

Name of the file where the plot should be saved, for example 'plot.png'. See the function ggsave in the ggplot2 package for supported file formats.

Details

Create a plot showing the smoothed calibration #'

Value

A cowplot object. Use the cowplot::save_plot function to save to file in a different format.


hxia/plp-git-demo documentation built on March 19, 2021, 1:54 a.m.