Assess a model's calibration via a calibration plot.
ggcalibration(
data,
y,
x,
n.groups = 10,
conf.level = 0.95,
ci.method = c("exact", "ac", "asymptotic", "wilson", "prop.test", "bayes", "logit",
"cloglog", "probit"),
geom_smooth.args = list(method = "loess", se = FALSE, formula = y ~ x, color = "black"),
geom_errorbar.args = list(width = 0),
geom_point.args = list(),
geom_function.args = list(colour = "gray", linetype = "dashed")
)
a data frame
variable name of the outcome coded as 0/1
variable name of the risk predictions
number of groups
level of confidence to be used in the confidence interval
method to use to construct the interval.
See binom::binom.confint()
for details
named list of arguments that will be passed
to ggplot2::geom_smooth()
. Default is
list(method = "loess", se = FALSE, formula = y ~ x, color = "black")
named list of arguments that will be passed
to ggplot2::geom_errorbar()
. Default is list(width = 0)
named list of arguments that will be passed
to ggplot2::geom_point()
. Default is list()
named list of arguments that will be passed
to ggplot2::geom_function()
and is the function that adds the 45 degree
guideline. Default is list(colour = "gray", linetype = "dashed")
ggplot