Estimates the calibration curve using a logistic generalized linear mixed model.
MIXC(
data = NULL,
p,
y,
cluster,
grid,
method = c("slope", "intercept"),
plot = TRUE,
cluster_curves = FALSE,
nsims_pi = 10000,
CI = TRUE,
CI_method = c("naive", "delta"),
cl.level = 0.95
)A list containing:
modelThe fitted mixed-effects model object
cluster_dataData frame with calibration data for each cluster
plot_dataData frame with calibration data for the average cluster
observed_dataData frame with calibration data for individual observations
plotA ggplot2 object if plot = TRUE, otherwise NULL
optional data frame containing the variables p, y,
and cluster. If supplied, variable names should be given without
quotation marks.
predicted probabilities (numeric vector) or name of the column in
data.
binary outcome variable or the name of the column in data.
Cluster identifier (factor, character, or integer) or name of
the column in data.
the grid for the calibration curve evaluation
character, type of mixed-effects model: "intercept" (random intercept)
or "slope" (random slope). Default is "slope".
logical, indicating whether to generate a calibration plot. Default is TRUE.
logical, whether to include cluster-specific curves in the plot.
Default is FALSE.
integer, number of simulations for prediction intervals. Default is 10000.
logical, whether to calculate confidence intervals. Default is TRUE.
character, method for computing the confidence intervals of the observed proportions.
If "delta", the delta method is applied. Conversely, when CI_method == "naive", no correction is applied.
Default is "naive".
the confidence level for the calculation of the confidence interval. Default is 0.95.
This function estimates the calibration curves using a logistic generalized linear mixed model.