# R-program for Supplementary Exercise 12.35 of IPS7e library(pwr) # squared effect size (balanced ANOVA) = SS(mu_1,...,mu_k)/(k*sigma^2) # k=number of groups and SS = sum of squared deviations from mean f2 <- ( (2.6-3.0)^2+(3.0-3.0)^2+(3.4-3.0)^2) / (3*(2.4^2)) f <- sqrt(f2) pwr.anova.test( f=f, k=3, n=c(50,100,150,175,200), sig.level=0.05)