loess_cal | R Documentation |
loess
calibration curve via loess
loess_cal(p, y, x, xp, save_data = TRUE, save_mod = TRUE, pw = FALSE)
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 |
list of class loess_cal
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.