← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-data-visualization-forest-funnel-plots / references / usage-guide.md

Forest and Funnel Plots - Usage Guide

Overview

Forest plots summarize per-study effect estimates with CIs, ordered vertically with a pooled summary diamond. Funnel plots diagnose publication bias by plotting effect vs precision; asymmetry suggests missing small-N null-result studies (Egger 1997). The first question for any meta-analysis is heterogeneity (I², τ²) - pooling without addressing high I² is biologically uninterpretable. metafor is the R reference; ggforest (survminer) covers Cox subgroup forests; MendelianRandomization for MR-specific forests.

Prerequisites

install.packages(c('metafor', 'forestplot', 'survminer', 'MendelianRandomization'))

Quick Start

Tell your AI agent what you want to do: - "Meta-analysis of 12 trials with random-effects REML; forest plot with log-scale OR axis" - "Cox subgroup forest from this model with interaction p-values" - "Funnel plot + Egger test for publication-bias diagnosis" - "Contour-enhanced funnel showing significance regions" - "MR forest with IVW, weighted-median, and MR-Egger methods"

Example Prompts

Standard meta-analysis

"Meta-analyze 15 RCTs of intervention X on binary outcome Y. Use REML random-effects. Forest plot with study weights, log-OR axis, summary diamond, 95% prediction interval, I² and Q-test annotated."

Cox subgroup forest

"Subgroup forest of treatment HR across age, sex, stage, and biomarker subgroups from coxph fit. Test interaction explicitly; annotate p-values."

Mendelian randomization forest

"MR forest with IVW (primary), weighted-median, weighted-mode, and MR-Egger sensitivity. Annotate per-method p-values."

Funnel and bias diagnostics

"Contour-enhanced funnel with 90/95/99 significance regions. Egger test if k ≥ 10. Trim-and-fill as sensitivity, NOT primary."

What the Agent Will Do

  1. Compute per-study effect (log-OR / log-HR / β) and variance.
  2. Fit random-effects REML model via metafor::rma (default unless homogeneous design justifies fixed-effect).
  3. Compute I², τ², Q-test, and 95% prediction interval.
  4. Render forest with log-scale x-axis for ratios; auto-sized boxes encoding weights; summary diamond at bottom.
  5. Annotate caption with I², τ², Q-p, prediction interval.
  6. Funnel plot + Egger test if k ≥ 10; trim-and-fill as sensitivity.
  7. For Cox subgroup forests, add treatment × subgroup interaction term to model and annotate interaction p.
  8. For MR, run multiple methods (IVW, weighted median, MR-Egger) and overlay in one forest.

Tips