Sample Size or Power for a One-Way Between-Subjects ANOVA Omnibus F Test
Source:R/ss_power_one_way_anova.R
ss_power_one_way_anova.RdDetermine the necessary total sample size to achieve a desired level of statistical power for the omnibus F test in a one-way between-subjects analysis of variance, or, given a total sample size, return the realized statistical power.
Usage
ss_power_one_way_anova(
a,
f = NULL,
eta_squared = NULL,
desired_power = 0.85,
alpha_level = 0.05,
N = NULL
)Arguments
- a
Number of groups (levels of the between-subjects factor)
- f
Cohen's f effect size (the population value); supply this or
eta_squared, but not both- eta_squared
Population eta squared (proportion of total variance accounted for by group membership); supply this or
f- desired_power
Desired statistical power (default 0.85)
- alpha_level
Type I error rate (default 0.05)
- N
Total sample size; if specified, the function returns the realized power (the ss_power_* family is not uniform here:
ss_power_contrasttakes a per-group size)
Value
A data.frame. When a sample size is being planned (N not
supplied) the rows are necessary_N, n_per_group, a,
noncentrality, and actual_power; the search constructs the total as
a balanced design, so n_per_group is a whole-number per-group count. When
N is supplied, power is evaluated at that total N directly and the
rows are specified_N, a, noncentrality, and
actual_power (no n_per_group row, since balance is not assumed).
The result carries the dmar_ss_power class, so
tidy and glance summarize it
in broom convention; the summarized sample size is the total N.
Details
Under the alternative hypothesis, the omnibus F statistic follows a noncentral F distribution with numerator df \(a - 1\), denominator df \(N - a\), and noncentrality parameter \(\lambda = N f^2\). Cohen's f relates to eta squared via \(f = \sqrt{\eta^2 / (1 - \eta^2)}\).
The function searches over total sample sizes \(N\) (treating per-group \(N/a\) as balanced)
until power first reaches desired_power. When N is supplied it instead reports the
realized power at that N.
References
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale, NJ: Lawrence Erlbaum.
Maxwell, S. E., Delaney, H. D., & Kelley, K. (2027). Designing experiments and analyzing data: A model comparison perspective (4th ed.). Routledge.
See also
ss_power_factorial_anova, ss_power_c, ss_power_sc, conf_limits_ncf
design_consequences for what a chosen design delivers:
power, the Type S (sign) and Type M (exaggeration) errors of the
significance filter, and the expected confidence interval width.
Other sample size for power:
power_fisher_exact(),
ss_aipe_mixed_effects(),
ss_power_R2(),
ss_power_R2_sensitivity(),
ss_power_c(),
ss_power_c_ancova(),
ss_power_composite_ancova(),
ss_power_composite_ancova_2group(),
ss_power_composite_anova(),
ss_power_composite_factorial_ancova(),
ss_power_composite_factorial_ancova_het(),
ss_power_composite_factorial_anova(),
ss_power_composite_sem(),
ss_power_contrast(),
ss_power_equivalence_c(),
ss_power_factorial_ancova(),
ss_power_factorial_anova(),
ss_power_indirect_effect(),
ss_power_mixed_effects(),
ss_power_pcm(),
ss_power_r(),
ss_power_rc(),
ss_power_reg_coef(),
ss_power_reg_coef_sensitivity(),
ss_power_rm_anova(),
ss_power_sc(),
ss_power_sem(),
ss_power_smd(),
ss_power_split_plot_anova()
Author
Ken Kelley kkelley@nd.edu
Examples
# Three groups, f = 0.25, power = .80
ss_power_one_way_anova(a = 3, f = 0.25, desired_power = 0.80)
#> term value
#> necessary_N 159
#> n_per_group 53
#> a 3
#> noncentrality 9.94
#> actual_power 0.805
# Same effect specified via eta squared
ss_power_one_way_anova(a = 3, eta_squared = 0.0588, desired_power = 0.80)
#> term value
#> necessary_N 159
#> n_per_group 53
#> a 3
#> noncentrality 9.93
#> actual_power 0.805
# Realized power at N = 60 across 3 groups
ss_power_one_way_anova(a = 3, f = 0.25, N = 60)
#> term value
#> specified_N 60
#> a 3
#> noncentrality 3.75
#> actual_power 0.374