# A 2 by 3 factorial ANOVA whose conclusion needs both main effects. Plan
# against their composite, not against either one alone.
ss_power_composite_factorial_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 25 per cell for a main effect and the
# three-way interaction of a 2 by 2 by 2 design.
ss_power_composite_factorial_anova(
factor_levels = c(2, 2, 2),
effects = list(list(factors = 1, f = 0.30, label = "A"),
list(factors = c(1, 2, 3), f = 0.25, label = "AxBxC")),
n_per_cell = 25)
# Naming one effect reproduces the single-effect planner exactly.
ss_power_composite_factorial_anova(
factor_levels = c(2, 3), effects = list(list(factors = 2, f = 0.25)),
n_per_cell = 20)
ss_power_factorial_anova(factor_levels = c(2, 3), effect_indices = 2,
f = 0.25, n_per_cell = 20)
# The figure of the purported population effect sizes.
plot(ss_power_composite_factorial_anova(
factor_levels = c(2, 3),
effects = list(list(factors = 1, f = 0.25),
list(factors = 2, f = 0.20)),
n_per_cell = 30))
# Stating the effects as population cell means with a common within-cell SD.
# plot() then draws the mean pattern, with error bars of one SD.
cell_means <- matrix(c(10, 12, 11,
13, 12, 16), nrow = 2, byrow = TRUE)
plot(ss_power_composite_factorial_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))
Run the code above in your browser using DataLab