ml_meta: Longitudinal Meta-Analysis with Robust Variance Estimation

View source: R/ml_meta.R

ml_metaR Documentation

Longitudinal Meta-Analysis with Robust Variance Estimation

Description

Fits a random-effects meta-analytic model at each unique time point in a long-format dataset of multi-wave effect sizes. Inference uses robust variance estimation (RVE) with optional Tipton (2015) small-sample corrections via the clubSandwich package.

Usage

ml_meta(
  data,
  yi,
  vi,
  study,
  time,
  alpha = 0.05,
  rho = 0.8,
  small_sample = TRUE,
  min_k = 2L,
  method = "REML",
  engine = c("rma.uni", "rma.mv")
)

Arguments

data

A data.frame in long format: one row per study x time point.

yi

Character. Name of the effect-size column.

vi

Character. Name of the sampling-variance column.

study

Character. Name of the study-ID column (cluster variable).

time

Character. Name of the follow-up time column (numeric).

alpha

Significance level for confidence intervals and p-values. Default 0.05.

rho

Assumed within-study correlation between effect sizes (used only when engine = "rma.mv"). Default 0.8.

small_sample

Logical. If TRUE (default), applies CR2 sandwich variance estimation with Satterthwaite degrees of freedom (Tipton, 2015). If FALSE, uses uncorrected z-based inference.

min_k

Integer. Minimum number of studies required to fit a model at a given time point. Default 2.

method

Character. Variance estimator passed to metafor. Default "REML".

engine

Character. Fitting engine: "rma.uni" (default) or "rma.mv". See section Engine choice.

Value

An object of class ml_meta (a data.frame) with one row per time point and columns: time, k, theta, se, df, t_stat, p_val, ci_lb, ci_ub, tau2, note.

Attributes:

"fits"

Named list of fitted model objects (one per time point).

"weights_by_time"

Named list of weight vectors for downstream use by ml_sens() and ml_benchmark().

"engine", "alpha", "rho", "small_sample"

Call metadata.

Engine choice

Two fitting engines are supported:

"rma.uni" (default)

metafor::rma.uni() – appropriate when each study contributes exactly one effect size per time point. Simpler, faster, and stores tau2 directly from the REML estimate.

"rma.mv"

metafor::rma.mv() with a prebuilt working covariance matrix – appropriate when studies contribute multiple effect sizes at the same time point (dependent effects within cluster). Requires the rho argument.

References

Hedges, L. V., Tipton, E., & Johnson, M. C. (2010). Robust variance estimation in meta-regression with dependent effect size estimates. Research Synthesis Methods, 1(1), 39-65.

Tipton, E. (2015). Small sample adjustments for robust variance estimation with meta-regression. Psychological Methods, 20(3), 375-393.

See Also

ml_sens(), ml_benchmark(), ml_spline()

Examples

dat <- sim_longitudinal_meta(k = 10, times = c(0, 6, 12), seed = 1)
result <- ml_meta(dat, yi = "yi", vi = "vi", study = "study", time = "time")
print(result)
plot(result)

# rma.mv engine for dependent effects

result_mv <- ml_meta(dat, yi = "yi", vi = "vi", study = "study", time = "time",
                     engine = "rma.mv", rho = 0.8)



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