Fig. 1 in words
Stones removed (success rate)
- Real kidney-stone data (Charig et al., 1986). B = percutaneous nephrolithotomy; dot area follows patient numbers. Stone size drove both the choice and the outcome.
- A · open surgery (blue) · B · PCNL (gold)
- success rate from 60% to 100%
- Small · < 2 cm: A 93% 81/87 · B 87% 234/270
- Large · ≥ 2 cm: A 73% 192/263 · B 69% 55/80
- All · stones: A 78% 273/350 · B 83% 289/350
- ① A, small stones · ② A, large stones · ③ B, all stones · ④ A, all stones
Entry 15 / 90
- Observer M. Tahri
- Seed 15
- Sim. patients 100 000
01 Fisher's Three Rules
- Replicate: to measure the error
- Randomize: chance assigns treatment
- Block: compare like with like
Fisher (1935), the tea test: 8 cups, 4 of each; a lucky guess of all: 1 in 70.
02 Confounding
- A third factor drives both the choice and the outcome
- Fig. 1: stone size. The code: severity
Adjusting fixes it only for what I measured: −1.262 became 0.996 once severity entered.
03 Randomize & Blind
- A coin, not a person, assigns
- Hide the next assignment; blind who measures
MRC streptomycin trial (1948): sealed envelopes. Its lasting lesson is concealment (Chalmers, 2011).
04 Many Tests, One Plan
- 20 null tests at α = 0.05: 64% chance of a false hit
- Holm (1979): the k-th smallest p faces α/(m − k + 1)
Name the primary outcome before the data.
05 Try It Yourself
sprint15_experimental_design_rigorous_inference.py
import numpy as np
rng = np.random.default_rng(15)
n = 100_000
z = lambda: rng.normal(size=n)
s = z() # severity
def y(t): # true effect of t: +1
return t - 2 * s + z()
def gap(t, o):
return o[t].mean() - o[~t].mean()
t = s + z() > 0 # sicker -> treated
o = y(t)
print(gap(t, o).round(3)) # observed
X = np.c_[np.ones(n), t, s]
b = np.linalg.lstsq(X, o)[0]
print(b[1].round(3)) # adjusted
r = rng.random(n) < .5 # coin flip
print(gap(r, y(r)).round(3)) # random
Output, as printed on the image
-1.262 0.996 0.998
Run it. sprint15_experimental_design_rigorous_inference.py · versions, data and steps
06 General Notes
- Write the protocol first
- Randomize what I cannot measure
- Adjust only for what came before treatment
- Report every outcome I tested
07 Mini Project
- Run a tea or coffee test: 8 cups, 4 of each
- Order by coin; a friend serves (blind)
- Drop s from X in the code: watch the bias return
R Trusted Sources
- Fisher (1935). The Design of Experiments. Oliver & Boyd
- Holm (1979). Scand. J. Stat. 6(2)
- Charig et al. (1986). BMJ 292, 879–882
- Julious & Mullee (1994). BMJ 309, 1480
- Medical Research Council (1948). Streptomycin Treatment of Pulmonary Tuberculosis
- Chalmers (2011). James Lind Library
- Montgomery. Design and Analysis of Experiments
