A fuel additive raises the mean mileage from 25.0 mpg by a true amount δ. Each study averages n cars with σ = 2.4 and tests H0: μ = 25.0 against μ > 25.0 at α = 0.05. The power is Φ(√n δ/σ − 1.645), which tends to 1 as n grows whatever δ > 0 is (top panel). So with enough cars a trivial improvement is declared statistically significant. The bottom panel shows twenty studies with their 95% intervals for the improvement: the test only says the interval is above 0, while the interval itself shows how big the improvement is and whether it clears the level that would matter to a consumer.
Studies are simulated from ȳ ~ Normal(25 + δ, σ2/n) with a seeded generator, so a preset always shows the same twenty. A study is "significant" when z = (ȳ − 25)/(σ/√n) ≥ 1.645; the interval is ȳ − 25 ± 1.96 σ/√n. The sample size for 90% power is ((1.645 + 1.282)σ/δ)2; power values are exact, from the formula in Filling the gap 6.7.
code/ch06_hypothesis_testing.py (power_z, power_curve_mpg, sample_size_z, n_for_effect).