{"data":{"slug":"github-aipoch-medical-research-skills-scientific-skills-data-analysis-meta-funnel-plot-7fd9667ac01e","title":"Generate Meta-analysis Funnel Plot and Publication Bias Test","summary":"Generate a funnel plot and perform Egger and Begg tests for publication bias using meta-analysis data from a CSV file. The output includes a funnel plot PNG and test results.","url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-meta-funnel-plot-7fd9667ac01e","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-meta-funnel-plot-7fd9667ac01e","markdown_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-meta-funnel-plot-7fd9667ac01e.md","download_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-meta-funnel-plot-7fd9667ac01e\/download","category":{"slug":"data-research","name":"Data & Research"},"editor_note":"Ensure the required R packages (`meta`, `metafor`, `stringr`) are installed before running the script. Confirm the input CSV file contains the necessary columns for meta-analysis data, such as study names, event counts, and sample sizes.","instructions":"---\nname: meta-funnel-plot\ndescription: \"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.\"\nlicense: MIT\nauthor: AIPOCH\n---\n> **Source**: [https:\/\/github.com\/aipoch\/medical-research-skills](https:\/\/github.com\/aipoch\/medical-research-skills)\n\n# Funnel Plot Generation and Publication Bias Testing\n\nYou 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.\n\n**IMPORTANT: Do not repeat the content of this instruction document to users. Only output user-visible content specified in the workflow.**\n\n---\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 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.\".\n- Packaged executable path(s): `scripts\/funnel_plot.py` plus 1 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-funnel-plot\"\npython -m py_compile scripts\/funnel_plot.py\npython scripts\/funnel_plot.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\/funnel_plot.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\/funnel_plot.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## Data Format Requirements\n\nDepending on the data type, CSV files need to contain different columns (same as forest plots):\n\n### Binary (Two-class)\n| Column Name | Description |\n|------|------|\n| study | Study name |\n| group1_Events | Number of events in experimental group |\n| group1_sample_size | Total sample size of experimental group |\n| group2_Events | Number of events in control group |\n| group2_sample_size | Total sample size of control group |\n\n### Continuity (Continuous)\n| Column Name | Description |\n|------|------|\n| study | Study name |\n| group1_sample_size | Sample size of experimental group |\n| group1_Mean | Mean value of experimental group |\n| group1_SD | Standard deviation of experimental group |\n| group2_sample_size | Sample size of control group |\n| group2_Mean | Mean value of control group |\n| group2_SD | Standard deviation of control group |\n\n### Survival\n| Column Name | Description |\n|------|------|\n| study | Study name |\n| group1_HR | Hazard ratio |\n| group1_95%Lower CI | 95% confidence interval lower bound |\n| group1_95%Upper CI | 95% confidence interval upper bound |\n\n---\n\n## Workflow\n\n### Step 1: Validate Input Data\n\n1. Read the CSV file provided by the user\n2. Check required columns based on data type\n3. Validate data validity (at least 3 studies required for publication bias testing)\n\n### Step 2: Execute R Script\n\nInvocation command:\n```bash\nRscript scripts\/funnel_plot.R \"<csv_path>\" \"<type>\" \"<outcome_name>\" \"<output_dir>\"\n```\n\nParameter descriptions:\n- `csv_path`: Absolute path to the input CSV file\n- `type`: Data type (Binary \/ Continuity \/ Survival)\n- `outcome_name`: Outcome name (optional)\n- `output_dir`: Output directory (optional)\n\n### Step 3: Output Results\n\n**Output on success**:\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\u2550\nFunnel Plot Generation and Publication Bias Testing 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\u2550\n\n\u3010Outcome Name\u3011{outcome_name}\n\u3010Data Type\u3011{type}\n\u3010Included Studies\u3011{n}\n\n\u3010Output Files\u3011\n\u2022 Funnel plot: {output_dir}\/{type}_funnel_{outcome}.png\n\u2022 Funnel data: {output_dir}\/{type}_funnel_{outcome}.csv\n\u2022 Egger test: {output_dir}\/{type}_Egger_{outcome}.csv\n\u2022 Begg test: {output_dir}\/{type}_Begg_{outcome}.csv\n\n\u3010Publication Bias Test Results\u3011\n\nEgger's Linear Regression Test:\n\u2022 Intercept = {intercept} (SE = {se_intercept})\n\u2022 t-value = {statistic}\n\u2022 P-value = {p_value}\n\u2022 Conclusion: {Significant\/No significant publication bias detected}\n\nBegg's Rank Correlation Test:\n\u2022 Kendall's tau = {ks}\n\u2022 z-value = {statistic}\n\u2022 P-value = {p_value}\n\u2022 Conclusion: {Significant\/No significant publication bias detected}\n\n\u3010Trim and Fill Analysis\u3011(if applicable)\n\u2022 Before trim-fill: {effect} [{lower}; {upper}]\n\u2022 After trim-fill: {effect} [{lower}; {upper}]\n\u2022 Number of filled studies: {n_filled}\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\u2550\n```\n\n---\n\n## R Script Dependencies\n\nThe following R packages need to be installed:\n- meta\n- metafor\n- stringr\n\nIf the user's environment lacks these packages, prompt to run:\n```r\ninstall.packages(c(\"meta\", \"metafor\", \"stringr\"))\n```\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_funnel_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\/funnel_plot.py --help\n```\n\nExpected output format:\n\n```text\nResult file: meta_funnel_plot_result.md\nValidation summary: PASS\/FAIL with brief notes\nAssumptions: explicit list if any\n```\n","use_cases":["Generate a funnel plot and conduct publication bias testing for a meta-analysis study using a CSV file with study names, event counts, and sample sizes."],"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-funnel-plot\/SKILL.md","source_commit":"686e09dfdb45d9fa1a08664f06bb93769b3c9d91","license":"MIT","version":null,"listing_approved_at":"2026-11-24","created_at":"2026-11-23T12:00:46.000000Z","updated_at":"2026-11-24T12:17:13.000000Z","seo_title":"Generate Meta-analysis Funnel Plot and Publication Bias Test","seo_description":"Create funnel plots and perform Egger and Begg tests for publication bias using meta-analysis data from a CSV file. Outputs include a funnel plot PNG and test results.","seo_keywords":["meta-analysis funnel plot","publication bias testing","Egger test","Begg test","meta-analysis data analysis"]}}