Sensitivity Analysis for Sample Size Planning From the AIPE Perspective for Omega Squared
Source:R/ss_aipe_omega_squared_sensitivity.R
ss_aipe_omega_squared_sensitivity.RdQuantifies how much misspecification of the population
\(\omega^2\) distorts an AIPE-based sample size plan. The planner
ss_aipe_omega_squared solves for the smallest N
that yields an expected CI width below the target at the planning
value. Here we generate G datasets from a balanced one-way
ANOVA with population \(\omega^2 = \)true_omega_squared and
df_effect + 1 groups at the planner-recommended N,
compute the noncentral F confidence interval on each
replication via ci_omega_squared, and summarize the
realized widths and coverage of true_omega_squared.
Usage
ss_aipe_omega_squared_sensitivity(
true_omega_squared = NULL,
estimated_omega_squared = NULL,
df_effect,
width,
specified_N = NULL,
conf_level = 0.95,
assurance = NULL,
G = 1000,
print_iter = FALSE,
save = FALSE,
filename = "ss_aipe_omega_squared_sensitivity_result.csv"
)Arguments
- true_omega_squared
Population \(\omega^2\) (the data generating value); in \([0, 1)\).
- estimated_omega_squared
\(\omega^2\) used to plan the study; supply this or
specified_Nbut not both.- df_effect
Numerator degrees of freedom for the omnibus F, equal to the number of groups minus 1.
- width
Desired full width of the confidence interval on \(\omega^2\).
- specified_N
Total sample size to evaluate (incompatible with
estimated_omega_squared).- conf_level
Confidence level (default
0.95).- assurance
Optional assurance probability passed to
ss_aipe_omega_squaredwhen resolving the planned sample size.- G
Number of Monte Carlo replications (default 1000).
- print_iter
Logical. Print iteration index per replication.
- save
Logical. If
TRUEwrite per-replication results tofilename.- filename
Path used when
save = TRUE.
Value
A data.frame with rows for mean / median / SD of
the realized \(\hat\omega^2\) and interval width, the proportion
of intervals at or below width, tail-specific and overall
empirical non-coverage of true_omega_squared, and the input
echoes, including assurance (present only when an
assurance was supplied).
References
Kelley, K. (2007). Confidence intervals for standardized effect sizes: Theory, application, and implementation. Journal of Statistical Software, 20(8), 1–24. doi:10.18637/jss.v020.i08
Maxwell, S. E., Delaney, H. D., & Kelley, K. (2027). Designing experiments and analyzing data: A model comparison perspective (4th ed.). Routledge. (See Chapter 3 on effect size measures.)
See also
ss_aipe_omega_squared, ci_omega_squared
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 AIPE sample size planning:
ss_aipe_c_sensitivity(),
ss_aipe_cliff_delta(),
ss_aipe_cliff_delta_sensitivity(),
ss_aipe_composite_sem(),
ss_aipe_equivalence_r(),
ss_aipe_equivalence_r_sensitivity(),
ss_aipe_equivalence_smd(),
ss_aipe_equivalence_smd_sensitivity(),
ss_aipe_icc(),
ss_aipe_icc_sensitivity(),
ss_aipe_indirect_effect(),
ss_aipe_indirect_effect_sensitivity(),
ss_aipe_mixed_effects_sensitivity(),
ss_aipe_omega_squared(),
ss_aipe_partial_r(),
ss_aipe_partial_r_sensitivity(),
ss_aipe_pcm_sensitivity(),
ss_aipe_r(),
ss_aipe_r_sensitivity(),
ss_aipe_reliability_sensitivity(),
ss_aipe_semipartial_r(),
ss_aipe_semipartial_r_sensitivity()
Author
Ken Kelley kkelley@nd.edu
Examples
# Well-specified: planner used omega^2 = 0.10, truth is 0.10.
# G is kept small here so the example runs quickly; raise it for a
# stable sensitivity estimate.
set.seed(113)
ss_aipe_omega_squared_sensitivity(
true_omega_squared = 0.10,
estimated_omega_squared = 0.10,
df_effect = 2, width = 0.10,
G = 25, print_iter = FALSE
)
#> During the iterative sample size search, the noncentral F lower-limit clamp in conf_limits_ncf() fired in 10 intermediate evaluations.
#> term value
#> mean_omega_squared 0.0665
#> median_omega_squared 0.0703
#> sd_omega_squared 0.0198
#> mean_ci_width 0.0848
#> median_ci_width 0.0878
#> sd_ci_width 0.0103
#> pct_ci_less_w 0.92
#> pct_ci_miss_low 0
#> pct_ci_miss_high 0.32
#> total_type_I_error 0.32
#> total_N 471
#> n_per_group 157
#> true_omega_squared 0.1
#> estimated_omega_squared 0.1
#> width 0.1
#> conf_level 0.95
#>
#> Confidence level: 95%