Skip to contents

Quantifies how much misspecification of the population semipartial correlation distorts an AIPE-based sample size plan. The function constructs a population covariance matrix whose implied semipartial correlation between Y and \(X_1\) (partialing \(X_2, \ldots, X_J\) out of \(X_1\) only, not out of Y) equals true_r_sp, then on each replication draws an n-row sample, computes the sample semipartial correlation, and forms a Fisher's \(Z\)-style CI scaled by the standardized regression coefficient.

Usage

ss_aipe_semipartial_r_sensitivity(
  true_r_sp = NULL,
  estimated_r_sp = NULL,
  J,
  width,
  specified_N = NULL,
  conf_level = 0.95,
  assurance = NULL,
  G = 1000,
  print_iter = FALSE,
  save = FALSE,
  filename = "ss_aipe_semipartial_r_sensitivity_result.csv"
)

Arguments

true_r_sp

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

estimated_r_sp

Planning value passed to ss_aipe_semipartial_r; supply this or specified_N but not both.

J

Total number of predictors. Must be at least 1.

width

Desired full width of the CI on the semipartial correlation.

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.

save

Logical. Save per-replication CSV.

filename

Path used when save = TRUE.

Value

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

References

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

set.seed(113)
ss_aipe_semipartial_r_sensitivity(
  true_r_sp = 0.30, estimated_r_sp = 0.30, J = 3, width = 0.20,
  G = 50, print_iter = FALSE
)
#>  term               value  
#>  mean_r_sp          0.307  
#>  median_r_sp        0.301  
#>  sd_r_sp            0.0521 
#>  mean_ci_width      0.198  
#>  median_ci_width    0.199  
#>  sd_ci_width        0.00731
#>  pct_ci_less_w      0.54   
#>  pct_ci_miss_low    0.04   
#>  pct_ci_miss_high   0      
#>  total_type_I_error 0.04   
#>  total_N            323    
#>  J                  3      
#>  true_r_sp          0.3    
#>  estimated_r_sp     0.3    
#>  width              0.2    
#>  conf_level         0.95   
#> 
#> Confidence level: 95%