Skip to contents

Summarize a pmcalibration object

Usage

# S3 method for class 'pmcalibration'
summary(object, conf_level = 0.95, ...)

Arguments

object

object created with pmcalibration

conf_level

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

...

ignored

Value

prints a summary of calibration metrics. Returns a list of two tables: metrics and plot

Examples

library(pmcalibration)
# simulate some data with a binary outcome
n <- 500
dat <- sim_dat(N = n, a1 = .5, a3 = .2)
head(dat)
#>            x1          x2 y          LP
#> 1  0.38019967 -0.84698687 0 -0.03119203
#> 2 -1.51760209 -0.98065777 0 -1.70061020
#> 3 -0.09620778 -0.64314055 0 -0.22697330
#> 4  0.70967500 -0.41240988 1  0.73872972
#> 5 -0.78327597  0.01902665 0 -0.26722994
#> 6  0.82607637  2.33121484 1  4.04244350
# 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")


summary(cal)
#> Calibration metrics based on a calibration curve estimated for a binary outcome via a generalized additive model (see ?mgcv::s) using logit transformed predicted probabilities.
#> 
#>      Estimate
#> Eavg    0.036
#> E50     0.032
#> E90     0.061
#> Emax    0.190
#> ECI     0.212