calib_plot_c | R Documentation |
Produce a calibration plot for a set of predicted and observed values reflecting a continuous outcome.
calib_plot_c(
form,
data,
cuts = 10,
refline = TRUE,
smooth = FALSE,
fitline = FALSE,
rug = FALSE
)
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. |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.