Ma Meta Analysis
Researchma-meta-analysisMa 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.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
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.csv05_extraction/data-dictionary.md
Outputs
06_analysis/01_setup.R06_analysis/02_effect_sizes.R06_analysis/03_models.R06_analysis/04_subgroups_meta_regression.R06_analysis/05_plots.R06_analysis/06_tables.R06_analysis/07_sensitivity.R06_analysis/08_bias.R06_analysis/09_validation.R06_analysis/07_export_tables.R06_analysis/figures/PNG files at 300 dpi06_analysis/tables/PNG + HTML + DOCX + CSV tables (viagt+flextable)06_analysis/validation.md06_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
- Initialize
renvin06_analysis/and record package versions.- Run
renv::init()in06_analysis/ - Creates
06_analysis/renv.lock
- Run
- Copy the R templates from
assets/r/into06_analysis/and adapt them to the study schema.- Copy
assets/r/01_setup.R→06_analysis/01_setup.R - Copy templates 02-09 similarly
- Copy
- Compute effect sizes with
metafor::escalcfor the outcome type.- In
06_analysis/02_effect_sizes.R(usemetafor::escalc()function)
- In
- Fit primary models using
metaand/ormetaforwith REML + Hartung-Knapp defaults.- In
06_analysis/03_models.R(L10-30: metagen(..., method.tau = "REML", hakn = TRUE))
- In
- Assess heterogeneity (I2, Q, tau2), subgroup analyses, and meta-regression when applicable.
- In
06_analysis/04_subgroups_meta_regression.R
- In
- Conduct sensitivity analyses and publication bias diagnostics.
- In
06_analysis/07_sensitivity.R - In
06_analysis/08_bias.R
- In
- 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))
- In
- Use
gtsummaryto build manuscript-ready summary tables.- In
06_analysis/06_tables.R(usegtsummary::tbl_summary())
- In
- Export tables as PNG/HTML/DOCX via
gt+flextablefor manuscript sync.- In
06_analysis/07_export_tables.R - Write to
06_analysis/tables/*.png,06_analysis/tables/*.html,06_analysis/tables/*.docx
- In
- Summarize key results and decisions in
06_analysis/validation.md.- Write to
06_analysis/validation.md
- Write to
Resources
assets/r/provides a scaffolded R workflow that maps to the standard steps.references/r-meta-roadmap.mdsummarizes 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
| Step | Skill | Stage |
|---|---|---|
| Prev | /ma-data-extraction | 05 Data Extraction |
| Next | /ma-manuscript-quarto | 07 Manuscript Drafting |
| All | /ma-end-to-end | Full pipeline orchestration |