Sensitivity Analysis for Sample Size Planning From the AIPE Perspective for an Equivalence-Test SMD
Source:R/ss_aipe_equivalence_smd_sensitivity.R
ss_aipe_equivalence_smd_sensitivity.RdQuantifies how much misspecification of the population standardized
mean difference distorts an AIPE-based sample size plan for the
two-one-sided-tests (TOST) confidence interval on the SMD. On each
replication the function simulates two normal groups of size n
per group with population standardized mean difference
true_smd, computes the SMD and its noncentral t
confidence interval via ci_smd, and summarizes the
realized widths and the proportion of replications in which the
computed interval falls entirely inside (equivalent) the
specified equivalence bounds.
Usage
ss_aipe_equivalence_smd_sensitivity(
true_smd = 0,
estimated_smd = NULL,
width,
delta_lower = NULL,
delta_upper = NULL,
n_per_group = NULL,
conf_level = 0.95,
assurance = NULL,
G = 1000,
print_iter = FALSE,
save = FALSE,
filename = "ss_aipe_equivalence_smd_sensitivity_result.csv"
)Arguments
- true_smd
Population standardized mean difference (the data generating value). Defaults to
0(perfect equivalence).- estimated_smd
Planning value of the population SMD passed to
ss_aipe_equivalence_smd; supply this orn_per_groupbut not both.- width
Desired full width of the two-sided CI on the SMD.
- delta_lower, delta_upper
Equivalence bounds on the SMD, as positive magnitudes with the same meaning as in
equivalence_smd: the region is \((-\code{delta_lower}, \code{delta_upper})\).delta_upperis required;delta_lowerdefaults todelta_upper(a symmetric region). The simulator records whether the realized CI falls entirely inside the region.- n_per_group
Per-group sample size to evaluate.
- conf_level
Confidence level (default
0.95).- assurance
Optional assurance probability.
- G
Number of Monte Carlo replications.
- print_iter
Logical.
- save
Logical. Save per-replication CSV.
- filename
Path used when
save = TRUE.
Value
A data.frame with rows for mean / median / SD of
the realized SMD and CI width, the proportion of intervals at or
below width, tail-specific and overall non-coverage of
true_smd, the proportion of intervals classified as
equivalent (CI fully inside the bounds), and the input
echoes, including assurance (present only when an
assurance was supplied).
References
Kelley, K., & Rausch, J. R. (2006). Sample size planning for the standardized mean difference: Accuracy in parameter estimation via narrow confidence intervals. Psychological Methods, 11, 363–385. doi:10.1037/1082-989X.11.4.363
Maxwell, S. E., Delaney, H. D., & Kelley, K. (2027). Designing experiments and analyzing data: A model comparison perspective (4th ed.). Routledge.
See also
ss_aipe_equivalence_smd, equivalence_smd, ss_aipe_smd_sensitivity
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_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_omega_squared_sensitivity(),
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
# Reduced Monte Carlo sweep (small G) for a fast, illustrative run.
set.seed(113)
ss_aipe_equivalence_smd_sensitivity(
true_smd = 0.0,
estimated_smd = 0.0,
width = 0.30,
delta_upper = 0.20,
G = 50, print_iter = FALSE
)
#> term value
#> mean_smd -0.0106
#> median_smd -0.0104
#> sd_smd 0.0795
#> mean_ci_width 0.3
#> median_ci_width 0.3
#> sd_ci_width 0.000153
#> pct_ci_less_w 0.86
#> pct_equivalent 0.5
#> pct_ci_miss_low 0.02
#> pct_ci_miss_high 0.04
#> total_type_I_error 0.06
#> n_per_group 342
#> total_N 684
#> true_smd 0
#> estimated_smd 0
#> width 0.3
#> conf_level 0.95
#> delta_lower -0.2
#> delta_upper 0.2
#>
#> Confidence level: 95%