Home/Healthcare/meta-analysis-skill
M

meta-analysis-skill

by @Lokenqaq111v
4.0(20)

Run pairwise and network meta-analysis in R, supporting continuous, binary, prevalence, generic effect size, and NMA data. Suitable for rehabilitation and exercise science researchers to use extracted numeric CSV data for validation, synthesis, plotting, diagnostics, and generating reproducible Markdown reports; it does not handle literature searching, PDF numeric extraction, or automated GRADE/CINeMA rating.

meta-analysisrhealthcareevidence-synthesisnetwork-meta-analysisGitHub
Installation
git clone https://github.com/Lokenqaq111/meta-analysis-skill.git
compare_arrows

Before / After Comparison

1 组
Before

Researchers need to manually write R scripts: clean CSV files, select models, run meta/network meta packages, draw forest plots and funnel plots, check diagnostics, and assemble reports. This involves a lot of repetitive work and makes it easy to miss validation steps.

After

Call tested scripts in the repository to automatically complete data validation, continuous/binary/prevalence/network meta-analysis, plot diagnostics, and Markdown reports, while retaining logs and rerun.sh; the workflow is reproducible.

SKILL.md

name: meta-analysis-r description: Run tested R scripts for pairwise continuous, binary, generic, prevalence, or network meta-analysis after numeric data have already been extracted into CSV. Use for validation, synthesis, plots, diagnostics, and a reproducible Markdown report. Do not use for literature-only searches, protocol writing, extracting numbers from PDFs/abstracts, or automatic GRADE/CINeMA/PRISMA scoring. metadata: short-description: Tested R engines for pairwise, prevalence, and network meta-analysis.

R Meta-analysis V2

Use repository scripts as the analysis engine. Do not rewrite a complete analysis.R from a prompt.

Hard rules

  1. Never invent numeric data. An empty required cell stops validation.
  2. Do not extract or estimate means, SDs, events, or sample sizes from a PDF or abstract. If the user explicitly requests a documented Cochrane 6.5.2 conversion from reported SE/CI/IQR data, record the source values, formula, and caveat in notes before analysis.
  3. Never install R packages silently. Report missing packages and the exact install command, then wait for authorization.
  4. Validate before analysis. Do not bypass a failed validator.
  5. Refuse meta-analysis with one independent study; suggest narrative synthesis.
  6. Preserve analysis.log, input data, parameters, rerun.sh, plots, summaries, notes, and report.md under the selected output directory.
  7. Do not apply a universal MCID. Use only a population-appropriate source supplied by the user.
  8. RoB, GRADE, and JBI content is a manual placeholder. Do not calculate an automatic certainty score.

Environment gate

Run from the skill repository root:

scripts/check_env.sh

Read ENV_REPORT.md. If R or required packages are unavailable, implement/validate what is possible, mark package-dependent work BLOCKED, and do not claim that the analysis pipeline was runtime-verified.

Select a mode

ModeMeasureTemplateUse
continuousSMD or MDtemplates/continuous_empty.csvTwo-arm aggregate continuous outcomes
binaryRR or ORtemplates/binary_empty.csvComparative event counts with intervention/control arms
genericDeclared effect measuretemplates/generic_empty.csvPre-calculated TE and seTE
prevalencePLOGITtemplates/prevalence_empty.csvSingle-group prevalence (events / total)
networkRR, OR, SMD, or MDtemplates/network_empty.csvConnected multi-treatment arm-level network

Prevalence is an independent mode. Never put single-group prevalence data into the comparative binary template.

Read references only when needed

Validate

The main runner validates automatically. A validation-only call is also available:

Rscript scripts/validate.R \
  --input path/to/input.csv \
  --mode continuous \
  --measure SMD

When a study contributes multiple outcomes, timepoints, or pairwise rows, select one using --outcome / --timepoint or stop and ask for a prespecified dependency decision. Pairwise shared controls stop by default.

Run

Rscript scripts/run_analysis.R \
  --input path/to/input.csv \
  --mode continuous \
  --measure SMD \
  --outdir output/topic \
  --topic topic

Optional arguments include:

  • --model random|common
  • --target-higher-is-better true|false
  • --outcome <name> and --timepoint <name>
  • --population <description> and --mcid-source <citation>
  • NMA: --reference <treatment> and --ranking P-score|SUCRA

Default output is ./output/<topic>/. Use a Desktop path only when the user explicitly asks for it.

Check outputs

Confirm that the output directory contains:

  • run_parameters.txt and executable rerun.sh;
  • analysis.log;
  • data/input.csv, data/validation.txt, data/summary.txt, data/notes.txt when notes exist, and data/sessionInfo.txt;
  • gated files under plots/ and data/;
  • report.md in the required section order.

Surface analysis failures verbatim. Do not edit outputs to conceal skipped or failed diagnostics.

Test the skill

tests/run_all.sh

A nonzero exit means V2 is not complete. BLOCKED is acceptable only when ENV_REPORT.md identifies environment branch B/C; every non-blocked test must pass.

--- README.md ---

meta-analysis-r V2

A Claude Code / Cursor skill backed by parameterized R scripts for aggregate-data meta-analysis. V2 validates an already extracted CSV, runs a repository-owned engine, saves reproducible parameters and logs, and writes plots plus a structured Markdown report.

Supported modes:

  • pairwise continuous: MD or Hedges' g SMD;
  • pairwise binary: RR or OR;
  • generic pre-calculated effects;
  • independent single-proportion prevalence mode;
  • technical frequentist network meta-analysis.

This project does not search literature, extract numeric data from PDFs, generate PRISMA flow diagrams, or automatically score GRADE, CINeMA, JBI, or risk of bias.

Requirements

  • R 4.0 or later;
  • R packages meta, metafor, and netmeta;
  • Claude Code or Cursor when used as an agent skill.

Check the actual runtime before analysis:

scripts/check_env.sh

If packages are missing, review ENV_REPORT.md and obtain approval before running:

install.packages(c("meta", "metafor", "netmeta"))

The skill never installs packages silently.

Install

Claude Code

git clone https://github.com/Lokenqaq111/meta-analysis-skill.git \
  ~/.claude/skills/meta-analysis-r

Cursor — user scope

git clone https://github.com/Lokenqaq111/meta-analysis-skill.git \
  ~/.cursor/skills/meta-analysis-r

Cursor — project scope

From the project root:

git clone https://github.com/Lokenqaq111/meta-analysis-skill.git \
  .cursor/skills/meta-analysis-r

Quick start

Copy an empty template and fill every required field:

cp templates/continuous_empty.csv my_input.csv

Validate without running a model:

Rscript scripts/validate.R \
  --input my_input.csv \
  --mode continuous \
  --measure SMD

Run the analysis:

Rscript scripts/run_analysis.R \
  --input my_input.csv \
  --mode continuous \
  --measure SMD \
  --outdir output/my-topic \
  --topic my-topic

The default output path is ./output/<topic>/; --outdir is configurable.

Input modes

ModeTemplateNotes
continuoustemplates/continuous_empty.csvDirection is explicit; MD requires comparable units
binarytemplates/binary_empty.csvComparative intervention/control events
generictemplates/generic_empty.csvPre-calculated TE / seTE
prevalencetemplates/prevalence_empty.csvSingle-group events / total; no control columns
networktemplates/network_empty.csvBinary or continuous arm-level data

Files ending in _template.csv contain synthetic Example* rows. Empty templates contain headers only.

Reproducible output

Each successful run writes:

output/<topic>/
├── analysis.log
├── report.md
├── rerun.sh
├── run_parameters.txt
├── data/
│   ├── input.csv
│   ├── validation.txt
│   ├── analysis_data.csv
│   ├── summary.txt
│   ├── notes.txt              # when warnings/skips exist
│   └── sessionInfo.txt
└── plots/
    └── ...                    # mode- and k-gated figures

Defaults and limits

  • Random effects with REML is the intervention default because the usual target is an average effect; it is configurable and is not a discipline-wide law.
  • The current non-deprecated Hartung-Knapp API is checked at runtime.
  • Diagnostics use unique study count, not CSV row count.
  • Small-study tests require at least ten studies and additional effect/precision checks.
  • No universal MCID is embedded. Clinical thresholds require a user-supplied, population-appropriate source.
  • NMA connectivity does not establish transitivity; V2 does not claim publication-grade NMA validity.

See references/ for the data dictionary, method rules, prevalence behavior, NMA limits, bias-test routing, report contract, and manual JBI checklist.

Tests

tests/run_all.sh

With R and all packages available, the R suite runs end-to-end examples. Without R, branch-C Python/shell checks run and package-dependent tests are reported as BLOCKED in TEST_LOG.md; they are never presented as passed.

License

MIT — see LICENSE.


中文说明

meta-analysis-r V2 是一个面向 Claude Code / Cursor 的 Meta 分析 Skill。与 V1 每次让模型重写整份 analysis.R 不同,V2 直接调用仓库内参数化 R 脚本:先校验 CSV,再运行分析,并保存日志、参数、复跑脚本、图和结构化报告。

支持连续型、二分类、预计算效应量、独立患病率和技术性网络 Meta 模式。患病率使用单组 events/total 模板,不能与治疗组/对照组的 binary 模板混用。

硬规则:不编造或从摘要猜数值;必填空格立即停止;不静默安装 R 包;一项独立研究拒绝做 Meta;风险偏倚、GRADE 和 JBI 只留人工填写栏,不自动打分。

安装路径:

# Claude Code
git clone https://github.com/Lokenqaq111/meta-analysis-skill.git ~/.claude/skills/meta-analysis-r

# Cursor 用户级
git clone https://github.com/Lokenqaq111/meta-analysis-skill.git ~/.cursor/skills/meta-analysis-r

# Cursor 项目级
git clone https://github.com/Lokenqaq111/meta-analysis-skill.git .cursor/skills/meta-analysis-r

正式运行前先执行 scripts/check_env.sh,再用 tests/run_all.sh 查看当前环境实际通过、失败或受阻的测试。没有 R 时必须保留 V2_VERIFIED=NO,不能宣称分析管线已经实测通过。

User Reviews (0)

Write a Review

Effect
Usability
Docs
Compatibility

No reviews yet

Statistics

Installs8
Rating4.0 / 5.0
Version
Updated2026年9月19日
Comparisons1

User Rating

4.0(20)
5
35%
4
35%
3
15%
2
10%
1
5%

Rate this Skill

0.0

Compatible Platforms

🔧Manual

Timeline

Created2026年9月19日
Last Updated2026年9月19日
🎁 Agent Knowledge Cards
Survey