Skip to content
svgbrushablepoint-range

Point-range (mean ± CI)

How do group means compare, with their uncertainty?

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

How to read it

  1. Compare the group means: the dark dots.
  2. Read the bars as the uncertainty of each mean.
  3. Check the raw points behind them for how varied individuals are.
  1. Callout 1: The dot: the group mean. The bar: its interval.
  2. Callout 2: Raw points: individuals vary far more than the mean does.

Watch out

  • Two overlapping intervals do not prove that two means are equal. Test the difference directly.

Defaults

Interval
Confidence interval (t)
What the interval shows: a confidence interval, a standard error or a standard deviation.
Also: ± 1 standard error · ± 1 standard deviation
Confidence level
0.95
How often intervals built this way contain the true value, over repeated samples.
Range 0.8 to 0.99, step 0.01
Raw points
On
Show each observation behind the summary.
Order
As in data
How rows or groups are ordered.
Also: By mean

Pinned in the code

  • CI: x̄ ± t(1 − α/2, n − 1)·s/√n per group (R `t.test(x)$conf.int`; independent groups, no pooling); SD uses n − 1.
  • ± SE and ± SD intervals are descriptive, not inferential — the axis label says which interval is drawn.
  • Overlapping 95 % CIs do not imply a non-significant difference (Cumming & Finch 2005); use the Analyze module for tests.
  • Raw points are jittered deterministically (seeded) so the picture is stable.
# Point-range (mean ± CI) — Codesplash Chart Lab (recipe "point-range")
# controls: interval=ci, level=0.95, points=true, sort=data
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats

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("point-range-demo.csv", keep_default_na=False, na_values=[""])  # demo data (only empty cells are missing): Chart Lab → Code → Download demo CSV
df["condition"] = pd.Categorical(df["condition"].astype("string"), categories=["Baseline", "Caffeine", "Sleep-deprived", "Music", "Dual task"])

d = df[["reaction_ms", "condition"]].dropna()
d["_g"] = d["condition"].astype(str)
order = [str(l) for l in df["condition"].cat.categories] if isinstance(df["condition"].dtype, pd.CategoricalDtype) else list(pd.unique(d["_g"]))
s = d.groupby("_g")["reaction_ms"].agg(["count", "mean", "std"]).reindex([l for l in order if l in set(d["_g"])])  # std uses n − 1
s["se"] = s["std"] / np.sqrt(s["count"])
s["half"] = stats.t.ppf(1 - (1 - 0.95) / 2, s["count"] - 1) * s["se"]  # t interval per group, as R t.test(x)$conf.int
s["half"] = s["half"].fillna(0)  # n < 2: the interval collapses to the mean
s = s.head(15)
LABEL = "reaction_ms (mean ± 95 % CI)"

fig, ax = plt.subplots(figsize=(7, 4.5))
xs = np.arange(len(s))
for i, level in enumerate(s.index):  # raw points, deterministic jitter
    v = d.loc[d["_g"] == level, "reaction_ms"].to_numpy()
    jitter = ((np.arange(1, v.size + 1) * 0.618034) % 1 - 0.5) * 0.36
    ax.scatter(i + jitter, v, s=8, color="#9aa0a6", alpha=0.5, zorder=1)
ax.errorbar(xs, s["mean"], yerr=s["half"], fmt="o", color=PALETTE[0], ecolor=PALETTE[0], elinewidth=2, capsize=4, markersize=7, zorder=3)
ax.set_xticks(xs, s.index)
ax.set_xlabel("condition")
ax.set_ylabel(LABEL)
plt.show()

Needs pandas, numpy, matplotlib, scipy · reads point-range-demo.csv · app theme from the optional codesplash helper