Skip to content
svgpareto-effects

Pareto chart of effects

Which effects are largest, and which exceed Lenth's margin of error?

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

How to read it

  1. Read the bars top down: the largest effects.
  2. Compare with the margin of error (ME) and the simultaneous margin (SME).
  3. Bars past SME stand out even after correcting for many comparisons.
  1. Callout 1: The largest effect.
  2. Callout 2: ME: the margin of error.
  3. Callout 3: SME: the simultaneous margin.

Watch out

  • Lenth's method assumes few active effects: if most are active, it underestimates the noise.

Defaults

Margin of error (ME; null = none)
6.08
Lenth's margin: an effect beyond this may be real.
Range 0 to 1,000,000,000, step 0.01
Simultaneous margin (SME; null = none)
12.36
Lenth's margin after correcting for testing all effects at once.
Range 0 to 1,000,000,000, step 0.01

Pinned in the code

  • Draws the run's numbers as given (computed by the Python/R engine); the chart computes nothing statistical.
  • Bars beyond ME are coloured; ME = t(0.975, d)·PSE with d = m/3 (Lenth 1989); SME uses the simultaneous quantile. The engine computes both.
# Pareto chart of effects — Codesplash Chart Lab (recipe "pareto-effects")
# controls: margin=6.08, smargin=12.36
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("pareto-effects-demo.csv", keep_default_na=False, na_values=[""])  # demo data (only empty cells are missing): Chart Lab → Code → Download demo CSV

_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")
E = "effect"
V = "|effect|"
ME, SME = 6.08, 12.36
d = df.dropna(subset=[E, V]).assign(a=lambda t: t[V].abs()).sort_values("a")  # largest at the top
fig, ax = plt.subplots(figsize=(8, 4.5))
ax.barh(d[E].astype(str), d["a"], color=[PALETTE[1] if ME is None or a > ME else "grey" for a in d["a"]])
if ME is not None: ax.axvline(ME, color=REF, linestyle="--", linewidth=1.2, label=f"ME {ME:g}")
if SME is not None: ax.axvline(SME, color="#ce5342", linestyle=":", linewidth=1.2, label=f"SME {SME:g}")
ax.set_xlabel(V)
ax.legend(fontsize=8)
plt.show()

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