Learn R Programming

pmcalibration (version 0.2.0)

lowess_cal: 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)

Value

list of class lowess_cal

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

Examples

Run this code
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)

Run the code above in your browser using DataLab