Back to skills
extension
Category: Productivity & OfficeNo API key required

revman-funnel

Generate funnel plots for assessing publication bias. Renders funnel plots with pseudo-95% CI lines and Egger's test. Use when the user types `revman funnel`.

personAuthor: TashanworldhubOpenAPI

RevMan Funnel Plot

Overview

Generates a funnel plot for publication bias assessment. Includes pseudo-95% confidence interval lines and automatic Egger's regression test.

Command

revman funnel [--outcome <id>] [--output <file>]

Procedure:

  1. If --outcome specified, read study data from the active review.

    • Determine active review from .revmanrc.
    • Read study files in {REVIEW_DIR}/.revman/studies/.
    • For each study with the specified outcome, extract TE and seTE.
    • Pooled estimate from fixed-effects inverse-variance.
    • If not, proceed with manual input.
  2. If no outcome specified, ask:

    Funnel plot data source:
      1. Auto-generate from study outcome data in active review
      2. Manual entry
    
  3. For manual entry, collect studies:

    • "Study label:" → label
    • "Effect estimate (TE):" → TE
    • "Standard error (seTE):" → seTE
    • "Add another study? (y/n):"
  4. Build JSON input:

    {
      "studies": [
        {"label": "Smith 2020", "TE": -0.5, "seTE": 0.3},
        {"label": "Jones 2021", "TE": -0.8, "seTE": 0.4}
      ],
      "pooled_te": -0.52,
      "effect_measure": "OR",
      "scale": "log"
    }
    
  5. Run:

    echo '<json>' | python3 scripts/revman-funnel.py -o {output_path}
    
  6. Output defaults to funnel_plot.png in the review root.

  7. Confirm and display Egger's test result:

    Funnel plot saved to reviews/{name}/funnel_plot.png
    Studies: {N}
    Egger's test: intercept = {x}, p = {y}
    

Script Location

scripts/revman-funnel.py — Python 3. Accepts JSON on stdin, writes PNG. Runs Egger's regression test automatically when ≥ 3 studies.


Error Handling

| Situation | Response | |-----------|----------| | < 3 studies | "Funnel plot requires at least 3 studies for meaningful interpretation. Generated without Egger's test." | | < 10 studies | "Warning: fewer than 10 studies. Egger's test has low power." | | Script not found | "Funnel plot script not found." |