Skip to content
svgcumulative-lift

Cumulative lift

Is the treatment effect stable over the test, or fading (novelty) or growing (primacy)?

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

How to read it

  1. Read the line as cumulative lift since launch.
  2. Early values swing widely, then settle.
  3. A steady fall may be novelty; a steady climb, primacy.
  1. Callout 1: Early: wide, unstable.
  2. Callout 2: Settled lift.
  3. Callout 3: The band still crosses zero.

Watch out

  • Peeking at this chart and stopping when it looks good inflates false positives.

Defaults

No settings: the chart draws one way.

Pinned in the code

  • Draws the run's numbers as given (computed by the Python/R engine); the chart computes nothing statistical.
  • Each point is the lift on all data up to that time (not the daily lift), so bands narrow as data accumulate; early wide swings are expected.
  • A trend after the band has narrowed suggests novelty or primacy effects — compare by days since first exposure, which the engine reports as a separate breakdown.
# Cumulative lift — Codesplash Chart Lab (recipe "cumulative-lift")
# controls: defaults
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-lift-demo.csv", keep_default_na=False, na_values=[""])  # demo data (only empty cells are missing): Chart Lab → Code → Download demo CSV
df["metric"] = pd.Categorical(df["metric"].astype("string"), categories=["conversion", "revenue per user"])

def levels_of(s):
    """Declared level order (categoricals), else order of first appearance."""
    if isinstance(s.dtype, pd.CategoricalDtype):
        return [v for v in s.cat.categories if (s == v).any()]
    return list(dict.fromkeys(s.dropna().astype(str)))
X = "day since launch"
Y = "cumulative relative lift"
LO = "ci_low"
HI = "ci_high"
G = "metric"
groups = levels_of(df[G]) if G else [None]
series = []
for name in groups:
    d = df if name is None else df[df[G].astype(str) == str(name)]
    series.append((name if name is not None else "", d.dropna(subset=[X]).sort_values(X)))
fig, ax = plt.subplots(figsize=(8, 4.5))
ax.axhline(0, color="grey", linewidth=0.8)
for i, (name, d) in enumerate(series):
    col = PALETTE[i % len(PALETTE)]
    if LO and HI:
        ax.fill_between(d[X], d[LO], d[HI], color=col, alpha=0.15, lw=0)
    ax.plot(d[X], d[Y], color=col, linewidth=2, label=name or Y)
ax.set_xlabel(X)
ax.set_ylabel(Y)
if G: ax.legend(fontsize=8)
plt.show()

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