Skip to main content

Try it in R: 16

Noise and evidence
Intermediate
Verify the 2 × 2 variance algebra showing why an interaction half as large as a main effect requires 16 times the sample size.
Published

November 11, 2026

Modified

November 15, 2026

Suppose a study is powered to detect a main effect of size \(\theta\). Researchers then split the sample in half (men vs. women, younger vs. older) and test an interaction—a difference of differences—that is realistically half as large (\(\delta = \theta / 2\)). Gelman’s rule of thumb 16 says that matching the main effect’s power for that interaction requires \(4^2 = 16\) times as many participants.

Step 1: Why the standard error doubles before the effect even shrinks

In a \(2 \times 2\) factorial design with n participants in each of the four cells and outcome SD \(\sigma = 1\), each cell mean has variance \(1/n\):

  • Main effect (average of two differences): \(\frac{1}{2}\big[(\bar y_{11} - \bar y_{01}) + (\bar y_{10} - \bar y_{00})\big]\), with standard error \(\sqrt{4 / (4n)} = 1/\sqrt{n}\).
  • Interaction (difference of two differences): \((\bar y_{11} - \bar y_{01}) - (\bar y_{10} - \bar y_{00})\), with standard error \(\sqrt{4 / n} = 2/\sqrt{n}\).

Run the simulation below to compare empirical SEs and power across sample sizes from \(n = 10\) to \(n = 1{,}280\) per cell.

Predict → Modify → Observe

  1. Read the horizontal gap at 80% power. In the table printed under the chart, find the cell size where main crosses 0.80 (around n = 40 to 80 per cell) and where interaction crosses 0.80 (around n = 640 to 1280 per cell).
  2. What if the interaction is just as big as the main effect? Change delta <- theta on line 3 (a full cross-over or zero-effect-in-one-group interaction) and click Run Code. Even when the interaction is equal in size to the main effect, how many times larger does n have to be for 80% power? (Answer: \(2^2 = 4\times\), because the SE is still twice as large.)

Step 2: Exact sample-size ratio from the normal distribution

We can verify the \(16\times\) factor analytically: for 80% power at the 5% two-sided level, a test needs an expected \(z\)-score of \(z_{0.975} + z_{0.80} \approx 1.96 + 0.84 = 2.80\).

Your turn: how exaggerated are “significant” interactions at main-effect sample sizes?

Suppose a researcher runs a study sized for 80% power on the main effect (n <- 50 per cell when theta <- 0.4), and also tests an interaction whose true size is delta <- 0.2.

Complete the code below to simulate 10,000 studies at n <- 50 per cell and compute: 1. exagg: the average magnitude mean(abs(inter[sig])) of the significant interaction estimates divided by the true delta. 2. wrong_sign: the fraction of significant interaction estimates that have the wrong sign (inter[sig] < 0).

Subset inter to the significant runs with inter[sig]. Then exagg <- mean(abs(inter[sig])) / delta and wrong_sign <- mean(inter[sig] < 0).

set.seed(80) n <- 50 # sized for ~80% power on the main effect (theta = 0.4) se_int <- 2 / sqrt(n) # interaction SE is 2 / sqrt(n) inter <- rnorm(10000, mean = delta, sd = se_int) sig <- abs(inter) > 1.96 * se_int exagg <- mean(abs(inter[sig])) / delta wrong_sign <- mean(inter[sig] < 0) cat( "Interaction power at n = 50 per cell: ", round(100 * mean(sig), 1), "%\n", "Average significant interaction is ", round(exagg, 1), "x the truth\n", "Share of significant interactions with wrong sign: ", round(100 * wrong_sign, 1), "%\n", sep = "" )
Show simulation code
set.seed(80)
n <- 50 # sized for ~80% power on the main effect (theta = 0.4)
se_int <- 2 / sqrt(n) # interaction SE is 2 / sqrt(n)

inter <- rnorm(10000, mean = delta, sd = se_int)
sig <- abs(inter) > 1.96 * se_int

exagg <- mean(abs(inter[sig])) / delta
wrong_sign <- mean(inter[sig] < 0)

cat(
  "Interaction power at n = 50 per cell: ", round(100 * mean(sig), 1), "%\n",
  "Average significant interaction is ", round(exagg, 1), "x the truth\n",
  "Share of significant interactions with wrong sign: ",
  round(100 * wrong_sign, 1), "%\n",
  sep = ""
)

Where next

  • Read the full entry: 16.
  • Continue to Lab 3: Try it in R: Multiple Comparisons, where partial pooling shrinks noisy subgroup estimates toward the overall mean instead of chasing noise.
Back to top