# A 2 by 3 factorial ANOVA whose conclusion needs both main effects, so the
# design is planned against their composite.
ss_power_composite_anova(
factor_levels = c(2, 3),
effects = list(list(factors = 1, f = 0.25),
list(factors = 2, f = 0.20)),
desired_power = 0.80)
# Realized composite power at 40 per cell for a main effect and the
# interaction of a 2 by 2 design, sizes given as partial eta squared.
ss_power_composite_anova(
factor_levels = c(2, 2),
effects = list(list(factors = 1, partial_eta_squared = 0.06),
list(factors = c(1, 2), partial_eta_squared = 0.04)),
n_per_cell = 40)
# The effects can instead be a full pattern of population cell means with a
# common within-cell SD; plot() then draws the mean pattern itself.
cell_means <- matrix(c(10, 12, 11,
13, 12, 16), nrow = 2, byrow = TRUE)
fit <- ss_power_composite_anova(
factor_levels = c(2, 3), means = cell_means, sigma = 4,
effects = list(list(factors = 1, label = "A"),
list(factors = 2, label = "B")),
n_per_cell = 30)
fit
plot(fit)
Run the code above in your browser using DataLab