knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 6, fig.height = 4 )
metaLong provides a coherent workflow for synthesising evidence from studies
that report outcomes at multiple follow-up time points. The package covers:
ml_meta() fits a random-effects model at each time point
using robust variance estimation (RVE) with Tipton small-sample corrections.ml_sens() computes the time-varying Impact Threshold for
a Confounding Variable (ITCV).ml_benchmark() compares observed covariate
partial correlations against the ITCV threshold.ml_spline() fits a natural cubic spline over time.ml_fragility() identifies how many study removals flip
significance.library(metaLong) dat <- sim_longitudinal_meta( k = 10, times = c(0, 6, 12, 24), mu = c("0" = 0.30, "6" = 0.50, "12" = 0.42, "24" = 0.20), tau = 0.20, seed = 42 ) head(dat, 6)
The data are in long format: one row per study x time combination.
ml_meta()ml_meta() fits an intercept-only random-effects model at each time point
with CR2 sandwich variance and Satterthwaite degrees of freedom.
meta <- ml_meta(dat, yi = "yi", vi = "vi", study = "study", time = "time") print(meta)
plot(meta, main = "Pooled Effects Across Follow-Up")
ml_sens()ml_sens() computes ITCV_alpha(t) — the minimum partial correlation an
omitted confounder must have with both treatment and outcome to render the
result non-significant.
sens <- ml_sens(dat, meta, yi = "yi", vi = "vi", study = "study", time = "time") print(sens)
plot(sens)
Key trajectory summaries:
cat("Minimum ITCV_alpha:", round(attr(sens, "itcv_min"), 3), "\n") cat("Mean ITCV_alpha: ", round(attr(sens, "itcv_mean"), 3), "\n") cat("Fragile proportion:", round(attr(sens, "fragile_prop"), 3), "\n")
ml_spline()spl <- ml_spline(meta, df = 2) print(spl)
plot(spl, main = "Spline Fit: Nonlinear Trajectory")
ml_plot()ml_plot(meta, sens_obj = sens, spline_obj = spl, main = "Longitudinal Meta-Analysis Profile")
ml_benchmark()ml_benchmark() regresses each observed study-level covariate and flags
those whose partial correlation exceeds the ITCV_alpha threshold.
bench <- ml_benchmark( dat, meta, sens, yi = "yi", vi = "vi", study = "study", time = "time", covariates = c("pub_year", "quality") ) print(bench)
ml_fragility()The fragility index is the minimum number of study removals that flip significance at a given time point.
frag <- ml_fragility(dat, meta, yi = "yi", vi = "vi", study = "study", time = "time", max_k = 1L, seed = 1) print(frag)
f <- fits(meta) cat("Stored model objects:", sum(!sapply(f, is.null)), "/", length(f), "\n")
Frank, K. A. (2000). Impact of a confounding variable on a regression
coefficient. Sociological Methods & Research, 29(2), 147--194.
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.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.