Learn R Programming

DMAR (version 1.0.0)

ss_aipe_equivalence_r_sensitivity: Sensitivity Analysis for Sample Size Planning From the AIPE Perspective for an Equivalence-Test Correlation

Description

Quantifies how much misspecification of the population correlation distorts an AIPE-based sample size plan for the two-one-sided-tests (TOST) confidence interval on the Pearson correlation. On each replication the function simulates N bivariate normal pairs with population correlation true_r, computes the sample correlation and its Fisher's \(Z\) confidence interval via ci_r, 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_r_sensitivity(
  true_r = 0,
  estimated_r = NULL,
  width,
  rho_lower = NULL,
  rho_upper = NULL,
  specified_N = 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 correlation and CI width, the proportion of intervals at or below width, tail-specific and overall non-coverage of true_r, 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_r

Population correlation (the data generating value). Defaults to 0 (no association, the exact equivalence case).

estimated_r

Planning value of the population correlation passed to ss_aipe_equivalence_r; supply this or specified_N but not both.

width

Desired full width of the two-sided CI on the correlation.

rho_lower, rho_upper

Equivalence bounds on the correlation, as positive magnitudes with the same meaning as in equivalence_r: the region is \((-\rho_L, +\rho_U)\). rho_upper is required; rho_lower defaults to rho_upper (a symmetric region). The simulator records whether the realized CI falls entirely inside the region.

specified_N

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 correlation, the two confidence limits, the interval width, whether the interval fell inside the equivalence region, and two indicators of whether the interval missed true_r 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

Counsell, A., & Cribbie, R. A. (2015). Equivalence tests for comparing correlation and regression coefficients. British Journal of Mathematical and Statistical Psychology, 68(2), 292--309. tools:::Rd_expr_doi("10.1111/bmsp.12045")

Goertzen, J. R., & Cribbie, R. A. (2010). Detecting a lack of association: An equivalence testing approach. British Journal of Mathematical and Statistical Psychology, 63(3), 527--537. tools:::Rd_expr_doi("10.1348/000711009X475853")

See Also

ss_aipe_equivalence_r, equivalence_r, ss_aipe_r_sensitivity, ss_aipe_equivalence_smd_sensitivity

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_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_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_r_sensitivity(
  true_r      = 0.0,
  estimated_r = 0.0,
  width       = 0.30,
  rho_upper   = 0.20,
  G = 50, print_iter = FALSE
)

Run the code above in your browser using DataLab