size.ci.cor {statpsych} | R Documentation |
Computes the sample size required to estimate a Pearson or partial correlation with desired confidence interval precision. Set s = 0 for a Pearson correlation. Set the correlation planning value to the smallest value within a plausible range for a conservatively large sample size.
size.ci.cor(alpha, cor, s, w)
alpha |
alpha level for 1-alpha confidence |
cor |
planning value of correlation |
s |
number of control variables |
w |
desired confidence interval width |
Returns the required sample size
Bonett DG, Wright TA (2000). “Sample size requirements for estimating Pearson, Kendall and Spearman correlations.” Psychometrika, 65(1), 23–28. ISSN 0033-3123, doi: 10.1007/BF02294183.
size.ci.cor(.05, .362, 0, .25) # Should return: # Sample size # [1,] 188