School/✦ Research Engineer/Week 31
How many runs? Power and sample size
Ten runs felt like plenty. Then a reviewer asks: what was your chance of detecting the effect if it was real?
About 45 min · 3 goals · Checked by automated tests
1.Why should I care?
Deciding the sample size in advance, from a pilot's spread and the smallest effect you care about, is what separates an experiment from a fishing trip. It also stops you collecting 'until it looks significant'.
- ◇ Explain power as the probability of detecting a true effect of a given size.
- ◇ Compute the runs needed for a target margin of error or 80% power.
- ◇ Explain why under-powered studies that 'succeed' overestimate effects.
2.Predict
You want to detect d = 0.5 with 80% power at α = 0.05. Roughly how many runs per group?
Guess first. Being wrong here is how the surprise works.
3.Discover
Set d = 0.5 and slide n until power reaches 80%. Then halve d: how many runs now? Switch α to 0.005 and watch the critical line move. Finally set n = 10 and read the smallest effect you could reliably detect.
Loading the interactive…
Can't use the interactive? Read a description instead
The power explorer draws two bell curves: the test statistic with no effect, and with the true effect. A red critical line marks significance; the shaded area of the second curve beyond it is the power. Sliders set effect size, runs per group and α; the readout gives power and the runs needed for 80% and 90%.
4.Checkpoint: guided practice
Check what you just discovered before going on. Hints appear after a wrong answer.
Practice 1 · a fresh version every time
A pilot suggests rover final position error has SD σ ≈ 0.1 m. How many trials n do you need so that the 95% margin of error 1.96·σ/√n is at most E = 0.1 m? Give the smallest whole number.
5.Watch
→ Watch how overlap between the two distributions sets power, then match it to the two curves in the explorer.
Defines power as the chance of detecting an effect that is really there, and shows how overlap between distributions sets it.
Length: see YouTube · captions on YouTube · source
Nothing loads from YouTube until you press play.
The video is optional: everything you need is also in the lesson text and the interactive.
6.Understand
Power
Power is the probability that your study detects an effect of a given size if it is really there. It rises with the true effect d, the number of runs n and a looser α. 80% is a common target, meaning a 20% chance of missing a real effect of size d.
Where σ and d come from
σ comes from a pilot or previous work. d should be the smallest effect you care about, not the effect you hope for: planning for a large hoped-for effect produces an under-powered study for the effect that matters.
The winner's curse
If power is low, only the studies that happened to overestimate the effect reach significance. So an under-powered study that 'succeeds' usually exaggerates. This is one reason small published studies often shrink on replication.
Explain it another way
Looking for a faint star needs a bigger telescope. Small effects need more runs to stand out from the noise.
Power = Φ(d√(n/2) − z₁₋α/₂) + Φ(−d√(n/2) − z₁₋α/₂) for a two-sided two-sample z test.
n = (1.96σ/E)² for a margin; n = 2((z₁₋α/₂ + z_power)/d)² per group for a two-sample comparison.
Simulated runs are cheap, so power is mainly a time question: 63 runs × 2 conditions × 2 min ≈ 4 hours. Physical tests would make the same calculation a cost question.
Derivation: Runs needed for a target margin
For a mean of n runs with SD σ, SE = σ/√n.
The 95% margin of error is E = 1.96 · σ/√n.
Solve for n: √n = 1.96σ/E, so n = (1.96σ/E)².
For a difference of two independent means with n each and the same σ: SE_diff = σ√(2/n).
For 80% power at two-sided α = 0.05 the expected statistic must sit 1.96 + 0.84 standard errors from zero: d·√(n/2) = 2.80.
So n per group = 2 · (2.80/d)² where d = δ/σ. Halving d quadruples n.
Worked example 1
Pilot SD 0.3 s; you want a 95% margin of 0.1 s on a mean. Runs?
n = (1.96 × 0.3 / 0.1)² = 5.88² = 34.6, so 35 runs. For a margin of 0.05 s: 138 runs.
Common mix-ups
- A non-significant result from a small study shows there is no effect.
✓ With low power, a real effect is often missed. Report the interval and the power for the effect that matters.
7.Practice on your own
Practice, not a test. Wrong answers get a hint and another try.
Practice 2 · a fresh version every time
You want 80% power to detect a true effect of Cohen's d = 0.4 with a two-sided test at α = 0.05, two equal independent groups. Using the normal approximation n = 2·((1.96 + 0.84)/d)², how many trials PER GROUP do you need (round up)?
Practice 3 · a fresh version every time
You run n = 36 trials and measure grasp force error. The sample standard deviation is s = 0.3 N. What is the standard error of the mean, in N?
Practice 4
Power 0.8 means…
Practice 5
Which d should you plan for?
Practice 6
A design needs 20 runs per group for d = 0.9. About how many for d = 0.45?
8.Apply it
Using a pilot estimate of σ for your capstone metric, compute the runs needed for your SESOI at 80% power and check it against your feasibility budget. If it does not fit, change the design, not the arithmetic.
9.Reflect
Concepts: Repeated trials and sample size · Experimental design and test protocols · Statistical inference: intervals, effect sizes and p-values