Each simulated experiment draws r observations from each of k normal populations with common standard deviation σ and the true means you choose, and forms F = MSTR/MSE as in Theorem 12.2.5. The bottom panel is the histogram of F over all experiments so far. The blue curve is the F density when all means are equal, Fk−1,n−k; the orange curve is the density that Theorem 12.A.2.2 predicts for the means you set, the noncentral F with parameter γ = Σ nj(μj − μ)2/σ2. The dashed line is the 5% cut-off; the share of experiments beyond it is the rejection rate, which for equal means is the size and otherwise the power.
code/ch12_analysis_of_variance.py (anova_oneway, noncentrality, power_f, sim_f_ratio).