lowess_cal: calibration curve via 'lowess'

View source: R/lowess_cal.R

lowess_calR Documentation

calibration curve via lowess

Description

uses lowess with iter = 0; as done in the rms package

Usage

lowess_cal(p, y, x, xp, save_data = TRUE)

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

Value

list of class lowess_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))

lowess_cal(y = dat$y, p = p, x = p, xp = NULL)

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