Skip to contents

Computes meta-analytical calibration curves using multiple methods (logistic regression, loess or splines) and performs meta-analysis across clusters to generate aggregated calibration curves with confidence and prediction intervals.

Usage

MAC2(
  data = NULL,
  p,
  y,
  cluster,
  grid,
  cl.level = 0.95,
  alpha.lr = 0.05/3,
  plot = TRUE,
  cluster_curves = FALSE,
  knots = 3,
  transf = "logit",
  method_choice = c("splines", "log", "loess"),
  method.tau = "REML",
  prediction = TRUE,
  random = TRUE,
  sm = "PLOGIT",
  hakn = FALSE,
  linewidth = 1,
  method.predict = "HTS",
  verbose = FALSE
)

Arguments

data

optional data frame containing the variables p, y, and cluster. If supplied, variable names should be given without quotation marks.

p

predicted probabilities (numeric vector) or name of the column in data.

y

binary outcome variable or the name of the column in data.

cluster

Cluster identifier (factor, character, or integer) or name of the column in data.

grid

the grid for the calibration curve evaluation

cl.level

the confidence level for the calculation of the confidence interval. Default is 0.95.

alpha.lr

the alpha-level used for the likelihood ratio test, selecting the number of knots for the restricted cubic splines

plot

logical, indicates whether to plot the calibration curves. Default is TRUE.

cluster_curves

logical, whether to include cluster-specific curves in the plot. Default is FALSE.

knots

integer, number of knots for splines. Default is 3.

transf

character, transformation for predictions: "logit" or "identity". Default is "logit".

method_choice

character, which method to use for meta-analysis. Options are: "log", "loess" or "splines". Default is "splines".

method.tau

character, method for between-study heterogeneity estimation. Default is "REML". This argument is passed to the metagen function.

prediction

logical, whether to compute prediction intervals. Default is TRUE. This argument is passed to the prediction argument of the metagen function.

random

logical, whether to use random-effects model. Default is TRUE. This argument is passed to the random argument of the metagen function.

sm

character, summary measure for meta-analysis. Default is "PLOGIT". This argument is passed to the sm argument of the metagen function.

hakn

logical, whether to use Hartung-Knapp adjustment. Default is FALSE. This argument is passed to the method.random.ci argument of the metagen function.

linewidth

numeric, line width for the meta-curve. Default is 1.

method.predict

character, method for prediction intervals. Default is "HTS". This argument is passed to the method.predict argument of the metagen function.

verbose

logical, indicates whether progress has to be printed in the console.

Value

A list containing:

cluster_data

Data frame with linear predictors and standard errors for each method per cluster

plot_data

Data frame with meta-analysis results including predictions and intervals

plot

A ggplot2 object if plot = TRUE, otherwise NULL

Details

This function estimates the center-specific calibration curves using logistic regression, loess or splines. Hereafter, it aggregates the calibration curves using meta-analytical techniques. The meta-analysis is performed using the function metagen from the meta package. The method_choice argument determines which method is for the meta-analytical aggregation.