gam_cal | R Documentation |
fits a calibration curve via gam
gam_cal(
y,
p,
x,
xp,
time = NULL,
save_data = TRUE,
save_mod = TRUE,
pw = FALSE,
...
)
y |
binary or a time-to-event ( |
p |
predicted probabilities |
x |
predictor (could be transformation of |
xp |
values for plotting (same scale as |
time |
time to calculate survival probabilities at (only relevant if |
save_data |
whether to save the data elements in the returned object |
save_mod |
whether to save the model in the returned object |
pw |
save pointwise standard errors for plotting |
... |
additional arguments for |
list of class gam_cal
library(pmcalibration)
# simulate some data
n <- 500
dat <- sim_dat(N = n, a1 = .5, a3 = .2)
head(dat)
# predictions
p <- with(dat, invlogit(.5 + x1 + x2 + x1*x2*.1))
gam_cal(y = dat$y, p = p, x = p, xp = NULL, k = 20, method="REML")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.