calib_plot_c: Produce a calibration plot for a set of predicted and...

View source: R/calib_plot_c.R

calib_plot_cR Documentation

Produce a calibration plot for a set of predicted and observed values reflecting a continuous outcome.

Description

Produce a calibration plot for a set of predicted and observed values reflecting a continuous outcome.

Usage

calib_plot_c(
  form,
  data,
  cuts = 10,
  refline = TRUE,
  smooth = FALSE,
  fitline = FALSE,
  rug = FALSE
)

Arguments

form

A formula where the left-hand side is the variable representing the observed outcome and the right-hand side represents the column names of the different models' continuous predictions.

data

A data frame that contains at least two columns, one of which is the observed outcome and the others that are predicted values

cuts

The number of bins of predictions. Default = 10.

refline

Whether or not to include a 45 degree reference line. Default = TRUE.

smooth

Whether or not to include a smoothed loess curve for each models' probabilities. Default = FALSE.

fitline

Whether or not to include a best-fit line for each models' predictions. Default = FALSE.

rug

Whether or not to include a rug plot of the observed outcomes Usually works best with only one model. Default = FALSE.

Examples

m1 <- lm(mpg ~ cyl + disp + hp, data = mtcars)
results <- data.frame(outcome = mtcars$mpg, lr_1 = predict(m1))
calib_plot_c(outcome ~ lr_1, data = results, cuts = 5)

gweissman/gmish documentation built on Feb. 21, 2025, 1:20 a.m.