Skip to content
svgcumulative-forest

Cumulative meta-analysis

When did the evidence become clear, and has it drifted as studies accumulated?

Demo data · seed 20261101 · 12 rows · default settings · 640 × 360SVG, lightSVG, darkDemo CSV

How to read it

  1. Read rows top down as studies get added.
  2. Watch when the interval stops crossing the reference.
  3. A drifting estimate suggests earlier studies differ from later ones.
  1. Callout 1: With the first study alone.
  2. Callout 2: All studies: the final pooled estimate.
  3. Callout 3: The reference line.

Watch out

  • Looking repeatedly inflates false positives, as with interim analyses in a trial.

Defaults

Reference (null) value
0
The value that means no effect, such as 0 for a difference or 1 for a ratio.
Range -1,000 to 1,000, step 0.1
Log scale (ratios)
Off
Use a log axis, the natural scale for ratios: 2 and ½ sit the same distance from 1.

Pinned in the code

  • Draws the meta-analysis engine's numbers as given (codesplash.stats.meta in Python ≡ codesplashr in R); the chart computes nothing statistical.
  • Row i is the meta-analysis of the first i studies in the engine's order; intervals narrow as evidence accumulates.
  • Repeated looks inflate false positives: a cumulative plot describes history, it is not a sequential test.
# Cumulative meta-analysis — Codesplash Chart Lab (recipe "cumulative-forest")
# controls: reference=0, log=false
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

try:
    import codesplash as cs  # optional: the app's chart theme
except ImportError:
    cs = None
if cs:
    cs.use_codesplash(dark=False)
PALETTE = cs.palette(dark=False)["categorical"] if cs else plt.rcParams["axes.prop_cycle"].by_key()["color"]

df = pd.read_csv("cumulative-forest-demo.csv", keep_default_na=False, na_values=[""])  # demo data (only empty cells are missing): Chart Lab → Code → Download demo CSV
df["added study"] = pd.Categorical(df["added study"].astype("string"), categories=["+ Aronson 1948", "+ Ferguson 1949", "+ Rosenthal 1960", "+ Hart 1977", "+ Frimodt 1973", "+ Stein 1953", "+ Vandiviere 1973", "+ Madras 1980", "+ Coetzee 1968", "+ Rosenthal 1961", "+ Comstock 1974", "+ Comstock 1969"])

_tokens = cs.palette(dark=False) if cs else {}
SEQ = _tokens.get("sequential", ["#eff6fd", "#1a469d"])  # sequential ramp (low → high)
DIV = _tokens.get("diverging", ["#c13e2e", "#f3f5f8", "#0859ac"])  # negative, midpoint, positive
REF = _tokens.get("reference", "#4e5661")
GREY = _tokens.get("dim", "#ced1d6")
LABEL = "added study"
EST = "risk ratio"
LOW = "low"
HIGH = "high"
LOG, REFERENCE = False, 0  # the "no effect" value: 0 for differences, 1 for ratios
d = df.dropna(subset=[EST]).reset_index(drop=True)
y = np.arange(len(d))[::-1]  # first row at the top
fig, ax = plt.subplots(figsize=(8, max(3, 0.32 * len(d) + 1.2)))
ax.axvline(REFERENCE, color=REF, linestyle="--", linewidth=1)
ax.hlines(y, d[LOW], d[HIGH], color=PALETTE[0], linewidth=1.4)
ax.plot(d[EST], y, "o", color=PALETTE[0], markersize=5)
if LOG:
    ax.set_xscale("log")
ax.set_yticks(y, d[LABEL].astype(str))
ax.set_xlabel(EST + " (each row pools the studies so far)")
fig.tight_layout()
plt.show()

Needs pandas, numpy, matplotlib · reads cumulative-forest-demo.csv · app theme from the optional codesplash helper