loess_cal {pmcalibration} | R Documentation |
calibration curve via loess
Description
calibration curve via loess
Usage
loess_cal(p, y, x, xp, save_data = TRUE, save_mod = TRUE, pw = FALSE)
Arguments
p |
predicted probabilities |
y |
binary outcome |
x |
predictor (could be transformation of |
xp |
values for plotting (same scale as |
save_data |
whether to save y, p, x, xp in the returned object |
save_mod |
whether to save the model in the returned object |
pw |
save pointwise standard errors for plotting |
Value
list of class loess_cal
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))
loess_cal(y = dat$y, p = p, x = p, xp = NULL)
[Package pmcalibration version 0.2.0 Index]