loess_cal: calibration curve via 'loess'

View source: R/loess_cal.R

loess_calR 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 p)

xp

values for plotting (same scale as x)

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)

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