Coding

Meta Analysis / 医学Meta分析

Try it

Comprehensive R-based meta-analysis skill covering RevMan 5.x + Stata equivalents (metareg/mvmeta) + esc + RVE + Bayesian NMA (Stan/JAGS) + survival meta + TSA + single-group meta + diagnostic meta + systematic review workflow; produces forest plots, funnel plots, heterogeneity (I²), publication bias, subgroup analysis, meta-regression, network meta, for a total of 23 analysis figures. Auto-switches language (defaults to English, switches to Chinese in zh-* environments). All analyses ship reproducible R code. / 基于 R 的全方位 Meta 分析技能,覆盖 RevMan 全部功能 + Stata 等价(metareg/mvmeta)+ esc + RVE + 贝叶斯 NMA(Stan/JAGS)+ 生存 Meta + TSA + 单组率 Meta + 诊断 Meta + 系统评价流程;输出森林图、漏斗图、异质性(I²)、发表偏倚、亚组分析、元回归、网络 Meta等共 23 种分析图形。中英双语自动切换(默认英文/中文环境切中文),所有分析提供可复现 R 代码。

What it does

Comprehensive R-based meta-analysis skill covering RevMan 5.x + Stata equivalents (metareg/mvmeta) + esc + RVE + Bayesian NMA (Stan/JAGS) + survival meta + TSA + single-group meta + diagnostic meta + systematic review workflow; produces forest plots, funnel plots, heterogeneity (I²), publication bias, subgroup analysis, meta-regression, network meta, for a total of 23 analysis figures. Auto-switches language (defaults to English, switches to Chinese in zh-* environments). All analyses ship reproducible R code. / 基于 R 的全方位 Meta 分析技能,覆盖 RevMan 全部功能 + Stata 等价(metareg/mvmeta)+ esc + RVE + 贝叶斯 NMA(Stan/JAGS)+ 生存 Meta + TSA + 单组率 Meta + 诊断 Meta + 系统评价流程;输出森林图、漏斗图、异质性(I²)、发表偏倚、亚组分析、元回归、网络 Meta等共 23 种分析图形。中英双语自动切换(默认英文/中文环境切中文),所有分析提供可复现 R 代码。

The skill document

Meta-Analysis / 医学Meta分析

R-based comprehensive meta-analysis. Every module ships reproducible R code.

Language / 语言

  • This skill is English-default; auto-switches to Chinese when OS locale is zh-*.
  • Detailed language policy → references/language_policy.md.
  • Chinese user guide → README_zh-CN.md
  • English user guide → README.md

Triage (ct-base §5.2)

On first user message, classify into one of three:

ClassificationConditionAction
SimpleSingle, specific intent (e.g., "pool OR from these 5 studies")Reply directly, no menu
ComplexMulti-decision / multi-parameter (e.g., "network meta with 3 interventions, subgroup, check inconsistency")Present level-1 routing menu incl. "③ Can't decide? → explain the differences between these choices" entry; full menu → references/interactive_menu.md
VagueUnclear what user wants (e.g., "I need meta-analysis help")Grill-me style branch questions, 1–3 per round

If unsure between Simple and Complex → give short reply + optional expansion hint.

Traceability / Grounding (ct-base §5.1)

All factual/assertive claims must cite source: specific ref-*.md section (e.g., §3.6) or official guideline. If a claim has no verifiable source → mark ⚠️ official verify and ask user to confirm against official text.

Initialization

  1. Integrity check: R source code is embedded as Python templates (scripts/r_*.py + r_templates.py) to comply with marketplace restrictions on .R files. On first use, run:
    bash scripts/check_integrity.sh   # exit 0 = ready
    
    • If scripts/*.R exists → ready; if missing → script auto-runs python r_templates.py to generate from templates.
  2. R env: Rscript --version → missing → https://cran.r-project.org/
  3. Install (manual): This skill does NOT auto-install R packages. Run bash scripts/check_integrity.sh or pre-analysis self-check to see missing packages; then manually install in R, or Rscript scripts/setup_packages.R to view full list.
    • Packages: metafor meta dmetar netmeta ggplot2 esc clubSandwich robumeta bayesmeta multinma gemtc dosresmeta survmeta mada metagear gridExtra ggforestplot svglite
    • ⚠️ Manual install connects to CRAN; use trusted network.
  4. Workspace: Create meta_analysis/ + output/ in current directory (⚠️ will write files).
  5. Memory: read ~/.workbuddy/MEMORY.md for R config (only R-related config keys; unrelated personal content is ignored and never sent anywhere).

Interactive Guide

Triage path: Vague → Level 1 menu (7 categories). Select → Level 2 with data-format hints. Sufficient info → skip menu, run analysis directly.

=== Level 1: Main ===
1️⃣ Pairwise Meta     4️⃣ Effect Size      7️⃣ Review Workflow
2️⃣ Heterogeneity & Bias  5️⃣ Visualization
3️⃣ Advanced Models   6️⃣ Study Quality
=== Level 2: Sub-Menus (excerpt) ===
[1] Pairwise: Binary(OR/RR/RD) | Continuous(SMD/MD) | Pre-calc(yi+CI) | Survival(HR/IRR) | Correlation(r→Zr)
[2] Heterogeneity: I²/Q/τ² | Subgroup | Meta-regression | Pub Bias(Egger/Begg/Trim-fill) | Sensitivity | GOSH | Baujat
[3] Advanced: Multi-arm NMA(netmeta) | Bayesian NMA Stan(multinma) | JAGS(gemtc) | Multilevel | Multivariate | IPD | Dose-Resp(dosresmeta) | Survival(survmeta) | TSA | Bootstrap
[4] Effect Size: Mean→d | t/F/r→d | d↔Hedges'g | d↔logOR | r↔Z | OR↔logOR | Batch
[5] Viz: Forest(5 themes) | Funnel | Bubble | GOSH | Network | League Table | RoB Traffic-light | Power Curve | Drapery
[6] Quality: RoB 1.0/2.0 | ROBINS-I | GRADE | PRISMA Checklist
[7] Workflow: PRISMA Flow | Screening GUI | PDF Batch-download (⚠️ opt-in) | Digitize | NNT Meta

Data formats & full details → references/interactive_menu.md

Other formats? Install @skill:statdata-transfer for 50+ format conversion.

Core Functions

ModuleR Packages & Functions
Single-Group Metametaprop() metamean() metainc() metacor() metarate()
Pairwise Metametabin() metacont() metagen() rma() — FE/RE(DL/HK)/MH/Peto
Effect Sizeescalc() esc_mean_sd() — SMD, OR, RR, RD, HR, ROM, ZCOR
Forest/Funnelforest() funnel() + ggplot2 (5 themes)
HeterogeneityI², Q, τ², H², 95% PI — auto-reported
Publication Biasregtest() ranktest() trimfill() selmodel()
Subgroup & Regrma(mods=~factor-1) + bubble()
SensitivityLeave-one-out, Cumul, GOSH, quality filter
Bayesian Pairwisebayesmeta::bayesmeta() — half-normal/JC prior
Bayesian NMArun_bayes_nma_multinma()(Stan) · run_bayes_nma_gemtc()(JAGS)
Multilevel/MV Metarma.mv() + UN/CS/HCS/AR1/ID/DIAG
Survival Metarun_surv_meta() — survmeta wrapper
TSA & Diagnosticsrun_tsa() · baujat() drapery() bootmeta()
Dose-Responserun_dose_resp() — dosresmeta wrapper
Diagnosis Metamada::reitsma() bivariate + SROC
RVE Robustrobumeta::robu() clubSandwich::vcovCR(CR2)
Review Workflowmetagear: PRISMA, screen, PDF, digitize
Qualityrob() RoB 1.0/2.0/ROBINS-I + GRADE
Powerrun_power_curve() + subgroup power

Reusable API (Mandatory)

Any analysis MUST call existing functions — never rewrite the full pipeline inline. Full function list + calling examples → references/advanced_api.md.

Security & Scope

Execution model: R analysis runs locally; skill does NOT auto-install R packages (missing → list + prompt manual install). PDF full-text download from external services ONLY on explicit user instruction. Analysis artifacts written to meta_analysis/ + output/ by default.

Not clinical judgment: Results require professional interpretation.

No literature DB search: Does not search literature databases; only downloads full text when user provides DOI/PMID.

Output

analysis_complete.R + forest/funnel (.svg+.png) + results_summary.md + data_backup.csv.

Output figures as editable SVG; editing + journal format conversion → references/svg_editing.md.

Units

See references/units.md for the full 5-field schema (input / output / dependency / AI autonomy / consumer units).

References

FileContent
interactive_menu.mdHow to use in a chat (user-friendly guide, 5 conversation examples)
ADVANCED.mdAdvanced reference (CLI, formulas, troubleshooting, full file structure)
ADVANCED_zh-CN.mdAdvanced reference (Chinese version)
revman_complete.mdRevMan→R 1:1 code mapping
stata_to_r_mapping.mdStata metareg/mvmeta→R equivalents
esc_robust_meta.mdEffect size conversions + RVE reference
advanced_analysis.mdMultilevel/IPD/Bayesian/Dose-Resp/Power
single_group_meta.mdmetaprop/metamean/metainc/metacor + NNT
bayesian_nma.mdmultinma (Stan) + gemtc (JAGS) full workflow
survival_meta.mdsurvmeta + KM pseudo-IPD reconstruction
tsa_diagnostics.mdTSA + Baujat + Drapery + Bootmeta
diagnosis_meta.mdmada::reitsma bivariate + SROC
review_workflow.mdmetagear: PRISMA, screening, PDF batch, digitize
data_templates.mdData input templates per type
citations.mdFull citation list
r_packages.mdPackage details & installation
advanced_api.mdReusable API reference
svg_editing.mdSVG editing tools & journal format conversion
units.mdAtomic task unit index (pipeline)
language_policy.mdBilingual policy detailed companion
report_template.mdReport skeleton reference

Project Files

README.md | README_zh-CN.md | CHANGELOG.md | AGENTS.md | LICENSE (MIT © 2025 medstatstar) | requirements.txt | assets/icon.svg

Changelog

Version / fix log → CHANGELOG.md.

Related skills

SCI journal selection assistant for meta-analysis and systematic review papers. Use this skill when the user has completed or is completing a meta-analysis a...

1 stars

AI-assisted meta-analysis workflow for hepatocellular carcinoma comparative effectiveness research. Six-element prompt framework covering full pipeline from...

1 installs

Sample size and power calculation tool for clinical trial practitioners. No local R install needed — a cloud R compute service covers all 49 test types and returns publication-grade SVG figures. Natural-language driven; full reproducible R code is returned by default; default output in Chinese or English per OS language setting (prompt can force-switch). / 为临床试验从业者提供的样本量与检验效能计算工具。本地无需安装 R,直接提供云端 R 计算服务(覆盖 49 种检验,并提供 SVG 出版级别图形)。自然语言驱动,默认回传完整 R 代码;默认按操作系统语言设定输出中文或英文(提示词可强制切换)。

药企药物研发辅助临床试验数据统计。参考 Statistical Analysis skill 的 descriptive statistics 与 group comparison 部分,构建试验分析支持能力。

13 installs

辅助完成测量系统分析(MSA),支持Gage R&R、偏倚、线性、稳定性分析;当用户需要进行测量系统评估、了解测量系统准确性、生成MSA分析报告时使用

1 installs

完整实证研究工作流管理技能。整合 codex-stata-for-economists 的工程化方法论与 Stata-MCP 执行工具。 使用场景:(1) Stata do-file 编写、调试、执行与优化 (2) 实证研究流水线搭建与项目管理 (3) 论文结果复现与审查(replication/robustness)(4) 计量经济学方法选择与实现 (5) 研究日志溯源校验(log verification)(6) 提交前质量审核与评分 当用户提到以下关键词时触发:stata, do文件, do-file, dofile, dta, 面板数据, panel, did, 双重差分, 倍分法,