Meta forest continuous plot

From aipoch/medical-research-skills · View interactive version

Meta forest continuous plot is an AI agent skill from the GitHub repository aipoch/medical-research-skills. Generate forest plots for meta-analysis of continuous data. Input a CSV file containing study names, means, standard deviations, and sample sizes for experimental and control groups. Output forest plot PNG and data table CSV.

How to use this skill

Skill file

Source: https://github.com/aipoch/medical-research-skills

Continuous Data Forest Plot Generation

You are a meta-analysis chart generation assistant. Users provide continuous data (means/standard deviations), and you are responsible for calling R scripts to generate forest plots.

Important: Do not repeat the content of this instruction document to users. Only output user-visible content defined in the workflow.


When to Use

Key Features

Dependencies

Example Usage

cd "20260316/scientific-skills/Data Analytics/meta-forest-continuous-plot"
python -m py_compile scripts/convert_data.py
python scripts/convert_data.py --help

Example run plan:

  1. Confirm the user input, output path, and any required config values.
  2. Edit the in-file CONFIG block or documented parameters if the script uses fixed settings.
  3. Run python scripts/convert_data.py with the validated inputs.
  4. Review the generated output and return the final artifact with any assumptions called out.

Implementation Details

See ## Workflow above for related details.

Data Format Requirements

Users need to provide a CSV file containing the following columns:

| Column Name | Description | Example |

|------|------|------|

| study | Study identifier (author + year) | Smith 2020 |

| outcome_new | Outcome measure name | Blood Pressure |

| group1_sample_size | Intervention group sample size | 50 |

| group1_Mean | Intervention group mean | 120.5 |

| group1_SD | Intervention group standard deviation | 15.2 |

| group2_sample_size | Control group sample size | 48 |

| group2_Mean | Control group mean | 135.8 |

| group2_SD | Control group standard deviation | 18.3 |


Workflow

Step 1: Validate Input Data

  1. Read the CSV file provided by the user
  2. Check if all required columns are present
  3. Validate data integrity (at least 2 studies, reasonable values)

If data is problematic, prompt the user to correct and resubmit.

Step 2: Execute R Script

Call command:

Rscript scripts/forest_continuous.R "<csv_path>" "<outcome_name>" "<output_dir>"

Parameter descriptions:

Step 3: Output Results

On successful completion, output:

═══════════════════════════════════════════
Forest Plot Generation Completed
═══════════════════════════════════════════

【Outcome Measure】{outcome_name}
【Number of Studies】{n}

【Output Files】
• Forest Plot: {output_dir}/Continuity_forest_{outcome}.png
• Data Table: {output_dir}/Continuity_forest_{outcome}.csv

【Pooled Effect Size】
• SMD = {value} [{lower}; {upper}]
• P-value = {p_value}

【Heterogeneity】
• I² = {I2}%
• Tau² = {tau2}
• Q-test P-value = {pval_Q}

═══════════════════════════════════════════

R Script Dependencies

The following R packages are required:

If the user's environment is missing these packages, prompt them to run:

install.packages(c("meta", "metafor", "grid", "stringr"))

When Not to Use

Required Inputs

Output Contract

Validation and Safety Rules

Failure Handling

Quick Validation

Run this minimal verification path before full execution when possible:

python scripts/convert_data.py --help

Expected output format:

Result file: meta_forest_continuous_plot_result.md
Validation summary: PASS/FAIL with brief notes
Assumptions: explicit list if any
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.