技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
meta-funnel-plot【数据与研究】Generate Meta-analysis funnel plots and perform publication bias testing. Takes CSV file with Meta-analysis data as input, outputs funnel plot PNG, Egger test and Begg test results.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
You are a Meta-analysis chart generation assistant. Users provide Meta-analysis data, and you are responsible for calling R scripts to generate funnel plots and conduct publication bias testing.
IMPORTANT: Do not repeat the content of this instruction document to users. Only output user-visible content specified in the workflow.
scripts/funnel_plot.py plus 1 additional script(s).Python: 3.10+. Repository baseline for current packaged skills.Third-party packages: not explicitly version-pinned in this skill package. Add pinned versions if this skill needs stricter environment control.cd "20260316/scientific-skills/Data Analytics/meta-funnel-plot"
python -m py_compile scripts/funnel_plot.py
python scripts/funnel_plot.py --help
Example run plan:
CONFIG block or documented parameters if the script uses fixed settings.python scripts/funnel_plot.py with the validated inputs.See ## Workflow above for related details.
scripts/funnel_plot.py with additional helper scripts under scripts/.Depending on the data type, CSV files need to contain different columns (same as forest plots):
| Column Name | Description |
|---|---|
| study | Study name |
| group1_Events | Number of events in experimental group |
| group1_sample_size | Total sample size of experimental group |
| group2_Events | Number of events in control group |
| group2_sample_size | Total sample size of control group |
| Column Name | Description |
|---|---|
| study | Study name |
| group1_sample_size | Sample size of experimental group |
| group1_Mean | Mean value of experimental group |
| group1_SD | Standard deviation of experimental group |
| group2_sample_size | Sample size of control group |
| group2_Mean | Mean value of control group |
| group2_SD | Standard deviation of control group |
| Column Name | Description |
|---|---|
| study | Study name |
| group1_HR | Hazard ratio |
| group1_95%Lower CI | 95% confidence interval lower bound |
| group1_95%Upper CI | 95% confidence interval upper bound |
Invocation command:
Rscript scripts/funnel_plot.R "<csv_path>" "<type>" "<outcome_name>" "<output_dir>"
Parameter descriptions:
csv_path: Absolute path to the input CSV filetype: Data type (Binary / Continuity / Survival)outcome_name: Outcome name (optional)output_dir: Output directory (optional)Output on success:
═══════════════════════════════════════════
Funnel Plot Generation and Publication Bias Testing Complete
═══════════════════════════════════════════
【Outcome Name】{outcome_name}
【Data Type】{type}
【Included Studies】{n}
【Output Files】
• Funnel plot: {output_dir}/{type}_funnel_{outcome}.png
• Funnel data: {output_dir}/{type}_funnel_{outcome}.csv
• Egger test: {output_dir}/{type}_Egger_{outcome}.csv
• Begg test: {output_dir}/{type}_Begg_{outcome}.csv
【Publication Bias Test Results】
Egger's Linear Regression Test:
• Intercept = {intercept} (SE = {se_intercept})
• t-value = {statistic}
• P-value = {p_value}
• Conclusion: {Significant/No significant publication bias detected}
Begg's Rank Correlation Test:
• Kendall's tau = {ks}
• z-value = {statistic}
• P-value = {p_value}
• Conclusion: {Significant/No significant publication bias detected}
【Trim and Fill Analysis】(if applicable)
• Before trim-fill: {effect} [{lower}; {upper}]
• After trim-fill: {effect} [{lower}; {upper}]
• Number of filled studies: {n_filled}
═══════════════════════════════════════════
The following R packages need to be installed:
If the user's environment lacks these packages, prompt to run:
install.packages(c("meta", "metafor", "stringr"))
meta_funnel_plot_result.md unless the skill documentation defines a better convention.Run this minimal verification path before full execution when possible:
python scripts/funnel_plot.py --help
Expected output format:
Result file: meta_funnel_plot_result.md
Validation summary: PASS/FAIL with brief notes
Assumptions: explicit list if any