| calibrate | R Documentation |
Validates predicted probabilities against a set of observed (binary) outcomes.
calibrate(
prob,
y,
method = c("pratt", "iso", "ns", "bins"),
pos.class = NULL,
probs = c(0.05, 0.35, 0.65, 0.95),
nbins = 10
)
## S3 method for class 'calibrate'
print(x, ...)
## S3 method for class 'calibrate'
plot(
x,
refline = TRUE,
refline.col = 2,
refline.lty = "dashed",
refline.lwd = 1,
...
)
prob |
Vector of predicted probabilities. |
y |
Vector of binary (i.e., 0/1) outcomes. If |
method |
Character string specifying which calibration method to use. Current options include:
|
pos.class |
Numeric/character string specifying which values in |
probs |
Numeric vector specifying the probabilities for generating the
quantiles of |
nbins |
Integer specifying the number of bins to use for grouping the probabilities. |
x |
An object of class |
... |
Additional optional argument to be passed on to other methods. |
refline |
Logical indicating whether or not to include a reference line. |
refline.col |
The color to use for the reference line. Default is
|
refline.lty |
The type of line to use for the reference line. Default is
|
refline.lwd |
The width of the reference line. Default is 1. |
A "calibrate" object, which is essentially a list with the
following components:
"probs"A data frame containing two columns: original
(the original probability estimates) and calibrated (the calibrated
probability estimates).
"calibrater"The calibration function (essentially a fitted model object) which can be used to calibrate new probabilities.
"bs"The Brier score between prob and y.
Harrell, Frank. (2015). Regression Modeling Strategies. Springer Series in Statistics. Springer International Publishing.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.