ml_benchmark: Benchmark Calibration of Longitudinal ITCV Against Observed...

View source: R/ml_benchmark.R

ml_benchmarkR Documentation

Benchmark Calibration of Longitudinal ITCV Against Observed Covariates

Description

For each follow-up time point, regresses each observed study-level covariate on the effect sizes using RVE meta-regression, extracts the covariate's partial correlation with the outcome, and compares it to the significance-adjusted ITCV threshold from ml_sens(). A covariate that beats the threshold demonstrates that real-world confounding of at least that magnitude exists, which is direct evidence of effect fragility.

Usage

ml_benchmark(
  data,
  meta_obj,
  sens_obj,
  yi,
  vi,
  study,
  time,
  covariates,
  alpha = NULL,
  rho = 0.8,
  small_sample = TRUE,
  min_k = 3L
)

Arguments

data

Long-format data.frame.

meta_obj

Output from ml_meta().

sens_obj

Output from ml_sens().

yi, vi, study, time

Column names.

covariates

Character vector of observed moderator column names to benchmark.

alpha

Significance level (inherits from meta_obj if NULL).

rho

Working within-study correlation for V matrix.

small_sample

Logical; use CR2 + Satterthwaite?

min_k

Minimum studies required at a time point. Default 3L (one extra relative to ml_meta() because regression needs more d.f.).

Value

Object of class ml_benchmark (a data.frame) with columns:

time

Follow-up time.

covariate

Covariate name.

k

Number of studies.

r_partial

Partial correlation of covariate with effect size.

t_stat, df, p_val

RVE inference for the covariate slope.

itcv_alpha

ITCV_alpha threshold at this time point.

beats_threshold

Logical: does ⁠|r_partial| >= itcv_alpha⁠?

skip_reason

Character; reason a cell was skipped, else NA.

The "fragile_summary" attribute contains one row per time with counts.

Interpretation

If an observed covariate (e.g., publication year, sample quality, attrition rate) has ⁠|r_partial| >= ITCV_alpha(t)⁠, then an unobserved confounder with the same relationship to exposure and outcome would be sufficient to nullify the pooled effect at time t. This does not prove confounding–it calibrates the plausibility threshold.

See Also

ml_sens(), ml_meta()

Examples


dat   <- sim_longitudinal_meta(k = 15, times = c(0, 6, 12), seed = 2)
meta  <- ml_meta(dat, yi = "yi", vi = "vi", study = "study", time = "time")
sens  <- ml_sens(dat, meta, yi = "yi", vi = "vi", study = "study", time = "time")
bench <- ml_benchmark(dat, meta, sens,
                       yi = "yi", vi = "vi", study = "study", time = "time",
                       covariates = c("pub_year", "quality"))
print(bench)
plot(bench)



metaLong documentation built on March 31, 2026, 1:07 a.m.