OpenParable
Skip to content
← Back to skills

Ma Meta Analysis

Research
ma-meta-analysis

Ma Meta Analysis is an Agent Skill for research published in the htlin222/meta-pipe repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Run statistical meta-analysis in R with renv, generate effect estimates, heterogeneity, and publication bias diagnostics, and export figures and tables. Use when analyzing extracted study data.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/htlin222/meta-pipe/blob/HEAD/ma-meta-analysis/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/ma-meta-analysis, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Ma Meta Analysis

Overview

Analyze extracted data using standard meta-analysis methods and produce validated outputs.

Inputs

  • 05_extraction/extraction.csv
  • 05_extraction/data-dictionary.md

Outputs

  • 06_analysis/01_setup.R
  • 06_analysis/02_effect_sizes.R
  • 06_analysis/03_models.R
  • 06_analysis/04_subgroups_meta_regression.R
  • 06_analysis/05_plots.R
  • 06_analysis/06_tables.R
  • 06_analysis/07_sensitivity.R
  • 06_analysis/08_bias.R
  • 06_analysis/09_validation.R
  • 06_analysis/07_export_tables.R
  • 06_analysis/figures/ PNG files at 300 dpi
  • 06_analysis/tables/ PNG + HTML + DOCX + CSV tables (via gt + flextable)
  • 06_analysis/validation.md
  • 06_analysis/renv.lock

Statistical Defaults

All models must use REML + Hartung-Knapp (Cochrane mandate, July 2025):

# meta:    metagen(..., method.tau = "REML", hakn = TRUE)
# metafor: rma(..., method = "REML", test = "knha")

Run DerSimonian-Laird as sensitivity analysis for comparison, but REML + HKSJ is the primary result.

Workflow

  1. Initialize renv in 06_analysis/ and record package versions.
    • Run renv::init() in 06_analysis/
    • Creates 06_analysis/renv.lock
  2. Copy the R templates from assets/r/ into 06_analysis/ and adapt them to the study schema.
    • Copy assets/r/01_setup.R → 06_analysis/01_setup.R
    • Copy templates 02-09 similarly
  3. Compute effect sizes with metafor::escalc for the outcome type.
    • In 06_analysis/02_effect_sizes.R (use metafor::escalc() function)
  4. Fit primary models using meta and/or metafor with REML + Hartung-Knapp defaults.
    • In 06_analysis/03_models.R (L10-30: metagen(..., method.tau = "REML", hakn = TRUE))
  5. Assess heterogeneity (I2, Q, tau2), subgroup analyses, and meta-regression when applicable.
    • In 06_analysis/04_subgroups_meta_regression.R
  6. Conduct sensitivity analyses and publication bias diagnostics.
    • In 06_analysis/07_sensitivity.R
    • In 06_analysis/08_bias.R
  7. Generate forest and funnel plots at 300 dpi.
    • In 06_analysis/05_plots.R
    • Write to 06_analysis/figures/*.png (png(..., res=300, width=3000, height=2400))
  8. Use gtsummary to build manuscript-ready summary tables.
    • In 06_analysis/06_tables.R (use gtsummary::tbl_summary())
  9. Export tables as PNG/HTML/DOCX via gt + flextable for manuscript sync.
    • In 06_analysis/07_export_tables.R
    • Write to 06_analysis/tables/*.png, 06_analysis/tables/*.html, 06_analysis/tables/*.docx
  10. Summarize key results and decisions in 06_analysis/validation.md.
    • Write to 06_analysis/validation.md

Resources

  • assets/r/ provides a scaffolded R workflow that maps to the standard steps.
  • references/r-meta-roadmap.md summarizes the expected analysis tasks.

Validation

  • Reproduce key estimates from at least one study subset.
  • Confirm that effect sizes match the extraction units and directionality.

Stage Exit: Stamp the artifact

Record provenance for the primary analysis outputs. See artifact-stamping.md.

uv run tooling/python/session_log.py --project <project-name> append \
  --stage 06_analysis \
  --artifact 06_analysis/results.rds \
  --generator ai \
  --notes "forestplot.png, league_table.csv generated from this run"

Pipeline Navigation

StepSkillStage
Prev/ma-data-extraction05 Data Extraction
Next/ma-manuscript-quarto07 Manuscript Drafting
All/ma-end-to-endFull pipeline orchestration