{"data":{"slug":"github-aipoch-medical-research-skills-scientific-skills-data-analysis-meta-forest-binary-plot-adbd24f26cb1","title":"Generate Binary Classification Forest Plot","summary":"Create forest plots for binary classification data using a CSV file with study names, event counts, and sample sizes for experimental and control groups. Output includes a PNG forest plot and a CSV data table.","url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-meta-forest-binary-plot-adbd24f26cb1","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-meta-forest-binary-plot-adbd24f26cb1","markdown_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-meta-forest-binary-plot-adbd24f26cb1.md","download_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-meta-forest-binary-plot-adbd24f26cb1\/download","category":{"slug":"data-research","name":"Data & Research"},"editor_note":"Ensure the input CSV file contains the required columns: study, outcome_new, group1_Events, group1_sample_size, group2_Events, and group2_sample_size. Install required Python packages (numpy, pandas, matplotlib) if they are not already installed.","instructions":"---\nname: meta-forest-binary-plot\ndescription: \"Generate meta-analysis forest plots for binary classification data. Input is a CSV file containing study names, event counts and sample sizes for experimental and control groups. Output includes forest plot PNG and data table CSV.\"\nlicense: MIT\nauthor: AIPOCH\n---\n> **Source**: [https:\/\/github.com\/aipoch\/medical-research-skills](https:\/\/github.com\/aipoch\/medical-research-skills)\n\n## When to Use\n\n- Use this skill when the request matches its documented task boundary.\n- Use it when the user can provide the required inputs and expects a structured deliverable.\n- Prefer this skill for repeatable, checklist-driven execution rather than open-ended brainstorming.\n\n## Key Features\n\n- Scope-focused workflow aligned to: \"Generate meta-analysis forest plots for binary classification data. Input is a CSV file containing study names, event counts and sample sizes for experimental and control groups. Output includes forest plot PNG and data table CSV.\".\n- Packaged executable path(s): `scripts\/extract_criteria.py` plus 2 additional script(s).\n- Structured execution path designed to keep outputs consistent and reviewable.\n\n## Dependencies\n\n- `Python`: `3.10+`. Repository baseline for current packaged skills.\n- `Third-party packages`: `not explicitly version-pinned in this skill package`. Add pinned versions if this skill needs stricter environment control.\n\n## Example Usage\n\n```bash\ncd \"20260316\/scientific-skills\/Data Analytics\/meta-forest-binary-plot\"\npython -m py_compile scripts\/extract_criteria.py\npython scripts\/extract_criteria.py --help\n```\n\nExample run plan:\n1. Confirm the user input, output path, and any required config values.\n2. Edit the in-file `CONFIG` block or documented parameters if the script uses fixed settings.\n3. Run `python scripts\/extract_criteria.py` with the validated inputs.\n4. Review the generated output and return the final artifact with any assumptions called out.\n\n## Implementation Details\n\nSee `## Workflow` above for related details.\n\n- Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.\n- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.\n- Primary implementation surface: `scripts\/extract_criteria.py` with additional helper scripts under `scripts\/`.\n- Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.\n- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.\n\n## Validation Shortcut\n\nRun this minimal command first to verify the supported execution path:\n\n```bash\npython scripts\/extract_criteria.py --help\n```\n\n# Binary Classification Data Forest Plot Plotting\n\nYou are a meta-analysis chart plotting assistant. Users provide binary classification data (event count\/sample size), and you are responsible for calling scripts to generate forest plots.\n\n**Important: Do not repeat the contents of this instruction document to users. Only output user-visible content as specified in the workflow.**\n\n---\n\n## Data Format Requirements\n\nUsers need to provide a CSV file containing the following columns:\n| Column Name | Description | Example |\n|------|------|------|\n| study | Study name (Author + Year) | Smith 2020 |\n| outcome_new | Outcome measure name | Mortality |\n| group1_Events | Number of events in experimental group | 15 |\n| group1_sample_size | Total sample size in experimental group | 100 |\n| group2_Events | Number of events in control group | 25 |\n| group2_sample_size | Total sample size in control group | 100 |\n\n---\n\n## Workflow\n\n### Step 1: Validate Input Data\n\n1. Read the CSV file provided by the user\n2. Check if all required columns are present\n3. Validate data quality (at least 2 studies, non-negative integer values)\n\n**If there are data issues, prompt the user to correct and resubmit.**\n\n### Step 2: Execute R Script (Priority)\n\nCall command:\n```bash\nRscript scripts\/forest_binary.R \"<csv_path>\" \"<outcome_name>\" \"<output_dir>\"\n```\n\nParameter descriptions:\n- `csv_path`: Absolute path to the input CSV file\n- `outcome_name`: Outcome measure name (optional, extracted from data by default)\n- `output_dir`: Output directory (optional, defaults to current directory)\n\n**If R script execution fails**, automatically fall back to Python script:\n```bash\npython scripts\/forest_binary.py \"<csv_path>\" --outcome \"<outcome_name>\" --output_dir \"<output_dir>\"\n```\n\n### Step 3: Output Results\n\n**Upon successful execution, output:**\n\n```\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nBinary Classification Forest Plot Complete\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n\n\u3010Outcome Measure\u3011{outcome_name}\n\u3010Number of Studies Included\u3011{n}\n\n\u3010Output Files\u3011\n\u2022 Forest Plot: {output_dir}\/Binary_forest_{outcome}.png\n\u2022 Data Table: {output_dir}\/Binary_forest_{outcome}.csv\n\n\u3010Combined Effect Size\u3011\n\u2022 OR = {value} [{lower}; {upper}]\n\n\u3010Heterogeneity\u3011\n\u2022 I\u00b2 = {I2}%\n\u2022 Tau\u00b2 = {tau2}\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n```\n\n---\n\n## Script Dependencies\n\n### R Script Dependencies\nThe R environment requires the following packages:\n- ggplot2\n- meta\n- gridExtra\n\n### Python Script Dependencies (Alternative)\nThe following Python packages are required:\n- numpy\n- pandas\n- matplotlib\n\nIf the user environment is missing these packages, prompt to run:\n```bash\npip install numpy pandas matplotlib\n```\n\nR script dependencies: meta, metafor, grid, stringr\n\n## When Not to Use\n\n- Do not use this skill when the required source data, identifiers, files, or credentials are missing.\n- Do not use this skill when the user asks for fabricated results, unsupported claims, or out-of-scope conclusions.\n- Do not use this skill when a simpler direct answer is more appropriate than the documented workflow.\n\n## Required Inputs\n\n- A clearly specified task goal aligned with the documented scope.\n- All required files, identifiers, parameters, or environment variables before execution.\n- Any domain constraints, formatting requirements, and expected output destination if applicable.\n\n## Output Contract\n\n- Return a structured deliverable that is directly usable without reformatting.\n- If a file is produced, prefer a deterministic output name such as `meta_forest_binary_plot_result.md` unless the skill documentation defines a better convention.\n- Include a short validation summary describing what was checked, what assumptions were made, and any remaining limitations.\n\n## Validation and Safety Rules\n\n- Validate required inputs before execution and stop early when mandatory fields or files are missing.\n- Do not fabricate measurements, references, findings, or conclusions that are not supported by the provided source material.\n- Emit a clear warning when credentials, privacy constraints, safety boundaries, or unsupported requests affect the result.\n- Keep the output safe, reproducible, and within the documented scope at all times.\n\n## Failure Handling\n\n- If validation fails, explain the exact missing field, file, or parameter and show the minimum fix required.\n- If an external dependency or script fails, surface the command path, likely cause, and the next recovery step.\n- If partial output is returned, label it clearly and identify which checks could not be completed.\n\n## Quick Validation\n\nRun this minimal verification path before full execution when possible:\n\n```bash\npython scripts\/extract_criteria.py --help\n```\n\nExpected output format:\n\n```text\nResult file: meta_forest_binary_plot_result.md\nValidation summary: PASS\/FAIL with brief notes\nAssumptions: explicit list if any\n```\n\n## Deterministic Output Rules\n\n- Use the same section order for every supported request of this skill.\n- Keep output field names stable and do not rename documented keys across examples.\n- If a value is unavailable, emit an explicit placeholder instead of omitting the field.\n\n## Completion Checklist\n\n- Confirm all required inputs were present and valid.\n- Confirm the supported execution path completed without unresolved errors.\n- Confirm the final deliverable matches the documented format exactly.\n- Confirm assumptions, limitations, and warnings are surfaced explicitly.\n","use_cases":["Generate forest plot for mortality outcomes in clinical trials","Visualize treatment effect sizes across multiple studies","Create meta-analysis plots for binary medical outcomes"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/aipoch\/medical-research-skills\/blob\/686e09dfdb45d9fa1a08664f06bb93769b3c9d91\/scientific-skills\/Data%20Analysis\/meta-forest-binary-plot\/SKILL.md","source_commit":"686e09dfdb45d9fa1a08664f06bb93769b3c9d91","license":"MIT","version":null,"listing_approved_at":"2026-11-24","created_at":"2026-11-23T11:56:57.000000Z","updated_at":"2026-11-24T12:17:13.000000Z","seo_title":"Generate Binary Classification Forest Plot","seo_description":"Create forest plots for binary classification data using CSV input with event counts and sample sizes. Output includes PNG and CSV files.","seo_keywords":["binary forest plot generator","meta analysis forest plot","clinical trial data visualization","binary classification plot","study effect size visualization"]}}