Skip to contents

Quantifies how much misspecification of the population Pearson correlation distorts an AIPE-based sample size plan. On each replication the function draws an n-row sample from a bivariate normal distribution with correlation true_rho and computes the sample correlation and its Fisher's \(Z\) CI, the interval ss_aipe_r plans for and correlations_test reports. Because the back-transformed width is largest at \(\rho = 0\) and shrinks as \(|\rho|\) grows, a planning value whose magnitude overstates the population correlation yields realized intervals wider than planned, and the summary rows report by how much.

Usage

ss_aipe_r_sensitivity(
  true_rho = NULL,
  estimated_rho = NULL,
  width,
  specified_N = NULL,
  conf_level = 0.95,
  assurance = NULL,
  G = 1000,
  print_iter = FALSE,
  save = FALSE,
  filename = "ss_aipe_r_sensitivity_result.csv"
)

Arguments

true_rho

Population Pearson correlation; must lie in \((-1, 1)\).

estimated_rho

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

width

Desired full width of the CI on the correlation.

specified_N

Sample size to evaluate (incompatible with estimated_rho).

conf_level

Confidence level (default 0.95).

assurance

Optional assurance probability passed to ss_aipe_r.

G

Number of Monte Carlo replications (default 1000).

print_iter

Logical. Print iteration index per replication.

save

Logical. If TRUE write per-replication results to filename.

filename

Path used when save = TRUE.

Value

A data.frame with rows for the realized correlation, the interval width, the proportion of intervals at or below width, tail-specific and overall non-coverage of true_rho, and the input echoes, including assurance (present only when an assurance was supplied).

References

Bonett, D. G., & Wright, T. A. (2000). Sample size requirements for estimating Pearson, Kendall and Spearman correlations. Psychometrika, 65(1), 23–28. doi:10.1007/BF02294183

Kelley, K., & Maxwell, S. E. (2003). Sample size for multiple regression: Obtaining regression coefficients that are accurate, not simply significant. Psychological Methods, 8(3), 305–321. doi:10.1037/1082-989X.8.3.305

Maxwell, S. E., Delaney, H. D., & Kelley, K. (2027). Designing experiments and analyzing data: A model comparison perspective (4th ed.). Routledge.

Author

Ken Kelley kkelley@nd.edu

Examples

# Reduced replications and a wide target interval keep this fast.
set.seed(113)
ss_aipe_r_sensitivity(
  true_rho = 0.30, estimated_rho = 0.30, width = 0.40,
  G = 50, print_iter = FALSE
)
#>  term               value 
#>  mean_r             0.289 
#>  median_r           0.278 
#>  sd_r               0.0867
#>  mean_ci_width      0.399 
#>  median_ci_width    0.404 
#>  sd_ci_width        0.0219
#>  pct_ci_less_w      0.44  
#>  pct_ci_miss_low    0     
#>  pct_ci_miss_high   0     
#>  total_type_I_error 0     
#>  total_N            81    
#>  true_rho           0.3   
#>  estimated_rho      0.3   
#>  width              0.4   
#>  conf_level         0.95  
#> 
#> Confidence level: 95%