Learn R Programming

DMAR (version 1.0.0)

ss_aipe_equivalence_smd_sensitivity: Sensitivity Analysis for Sample Size Planning From the AIPE Perspective for an Equivalence-Test SMD

Description

Quantifies 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,
  filename = NULL
)

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).

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 or n_per_group but 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 \((-\delta_L, +\delta_U)\), with delta_lower as \(\delta_L\) and delta_upper as \(\delta_U\). delta_upper is required; delta_lower defaults to delta_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.

filename

Optional path for a comma separated file recording every replication (the sample standardized mean difference, the two confidence limits, the interval width, whether the interval fell inside the equivalence region, and two indicators of whether the interval missed true_smd below or above): nothing is written when filename is NULL (the default), a new file with a header row is created otherwise, an existing file at that path is appended to, and a throwaway run should point it at tempfile(fileext = ".csv").

Author

Ken Kelley [email protected]

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. tools:::Rd_expr_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()

Examples

Run this code
# 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
)

Run the code above in your browser using DataLab