logistic_cal {pmcalibration} | R Documentation |
Run logistic calibration
Description
Assess 'weak' calibration (see, e.g., Van Calster et al. 2019) via calibration intercept and calibration slope.
Usage
logistic_cal(y, p)
Arguments
y |
binary outcome |
p |
predicted probabilities (these will be logit transformed) |
Value
an object of class logistic_cal
containing glm
results for calculating calibration intercept and calibration slope
References
Van Calster, B., McLernon, D. J., Van Smeden, M., Wynants, L., & Steyerberg, E. W. (2019). Calibration: the Achilles heel of predictive analytics. BMC medicine, 17(1), 1-7.
Examples
library(pmcalibration)
# simulate some data
n <- 500
dat <- sim_dat(N = n, a1 = .5, a3 = .2)
# predictions
p <- with(dat, invlogit(.5 + x1 + x2 + x1*x2*.1))
logistic_cal(y = dat$y, p = p)
[Package pmcalibration version 0.1.0 Index]