plot.pmcalibration: Plot a calibration curve ('pmcalibration' object)

plot.pmcalibrationR Documentation

Plot a calibration curve (pmcalibration object)

Description

This is for a quick and dirty calibration curve plot. Alternatively you can use get_cc() to get the data required to plot the calibration curve.

Usage

## S3 method for class 'pmcalibration'
plot(x, conf_level = 0.95, ...)

Arguments

x

a pmcalibration calibration curve

conf_level

width of the confidence interval (0.95 gives 95% CI). Ignored if call to pmcalibration didn't request confidence intervals

...

other args for plot() (lim and lab can be specified)

Value

No return value, called for side effects

Examples

library(pmcalibration)
# simulate some data with a binary outcome
n <- 500
dat <- sim_dat(N = n, a1 = .5, a3 = .2)
head(dat)
# predictions
p <- with(dat, invlogit(.5 + x1 + x2 + x1*x2*.1))

# fit calibration curve
cal <- pmcalibration(y = dat$y, p = p, smooth = "gam", k = 20, ci = "pw")

plot(cal)

pmcalibration documentation built on Sept. 8, 2023, 5:10 p.m.