Skip to content

wmotte/gtmeta

Repository files navigation

gtmeta

Vignette: An information-geometric tour of meta-analysis -- a worked, executable tour of the package: pooling as a barycenter, heterogeneity, exact inference, diagnostic accuracy with the SROC curve, and the robust Wasserstein-Fisher-Rao pool.

gtmeta is an R package for information-geometric meta-analysis. It represents a study as an estimated Gaussian sampling distribution and pools studies with Bures-Wasserstein, Fisher-Rao, or Wasserstein-Fisher-Rao geometry. The package also contains classical FE, RE, and UWLS benchmarks, simulation helpers, theorem-anchored tests, and adapters for Cochrane-style extracted estimates.

The package is deliberately conservative: geometric estimators are checked against familiar meta-analytic limits where those limits exist. In the scalar fixed-variance case, the Bures-Wasserstein mean reduces to the fixed-effect estimator; the Frechet-variance calibration recovers standard heterogeneity quantities; and the Wasserstein-Fisher-Rao pool gives a robust redescending estimator with a transparent cutoff.

The vignette linked above ships with the package (vignette("igmi-tour")) and is rebuilt as a standalone site with Rscript docs/build.R.

Meta-analysis as a barycenter of study distributions: each study is a Gaussian, the pooled estimate is their Frechet mean

Installation

# install.packages("remotes")
remotes::install_github("wmotte/gtmeta")

For local development from this directory:

R CMD build .
R CMD check --no-manual gtmeta_0.1.0.tar.gz

The core package depends on base R and metafor. Optional comparators and bridge packages are in Suggests:

  • mvmeta, mada, and metamisc for comparison models and diagnostic-accuracy benchmarks;
  • reticulate for the optional Python/POT Wasserstein-Fisher-Rao bridge;
  • testthat and withr for development tests.

Quickstart

library(gtmeta)

studies <- igmi_studies(
  yi  = c(0.42, 0.31, 0.55, 0.18, 0.40),
  sei = c(0.20, 0.18, 0.25, 0.15, 0.22)
)

fit <- bw_barycenter(studies, weights = igmi_precision_weights(studies))
fit$theta
fit$converged

Diagnostic test accuracy studies can be represented as bivariate Gaussian evidence on the logit sensitivity and logit specificity scale:

dta <- igmi_dta_studies(
  tp = c(80, 62), fn = c(20, 18),
  fp = c(9, 12),  tn = c(91, 88)
)

dta_studies <- lapply(dta, function(s) igmi_gaussian(s$theta, s$Sigma))
bw_barycenter(dta_studies)$theta

Repository layout

.
├── DESCRIPTION
├── NAMESPACE
├── R/                  # package source
├── man/                # generated Rd documentation
├── tests/testthat/     # theorem-anchored unit tests
├── sim/                # simulation drivers (paper Section 4)
├── emp/                # Cochrane corpus drivers (paper Section 5)
├── validate.R          # lightweight live numerical validation script
├── renv.lock           # local development dependency lockfile
└── .github/workflows/  # R CMD check workflow

The sim/ and emp/ directories hold the analysis scripts that reproduce the paper; they are excluded from the built package (.Rbuildignore) and their results/ outputs are regenerated by the scripts, not tracked.

Validation

Run the unit tests through R CMD check:

R CMD build .
R CMD check --no-manual gtmeta_0.1.0.tar.gz

For a smaller smoke gate that sources the package code directly:

RENV_CONFIG_AUTOLOADER_ENABLED=false Rscript validate.R

Some checks that use real external corpora or optional Python optimal-transport tooling skip cleanly when those resources are unavailable.

Reproducing the paper

The simulation and empirical numbers in the manuscript are reproduced by the scripts in sim/ and emp/, which source R/ directly (no installed build needed) and are run from the repository root. Dependencies are pinned in renv.lock.

# Simulation study (Section 4): writes to sim/results/
RENV_CONFIG_AUTOLOADER_ENABLED=false Rscript sim/sim_multivariate.R
RENV_CONFIG_AUTOLOADER_ENABLED=false Rscript sim/sim_contamination.R

# Cochrane corpus (Section 5): writes to emp/results/
RENV_CONFIG_AUTOLOADER_ENABLED=false Rscript emp/emp_univariate.R
RENV_CONFIG_AUTOLOADER_ENABLED=false Rscript emp/emp_multivariate.R

The empirical scripts read the openly available cochrane2025rob corpus; point GTMETA_COCHRANE_DIR at your local copy (default: ../cochrane2025rob_data). See sim/README.md and emp/README.md for the per-script arms, environment overrides, and expected runtimes.

License

GPL-3. The full license text is in LICENSE.md.

About

Geometric Meta-analysis

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages