Skip to contents

[Experimental]

This function performs sample size computation for testing Pearson's correlation, using uses Fisher's classic z-transformation to normalize the distribution of Pearson's correlation coefficient.

Usage

size_corr(
  r1,
  r0,
  alpha = 0.05,
  power = 0.8,
  alternative = c("two.sided", "less", "greater")
)

Arguments

r1

(numeric)
expected correlation coefficient of the evaluated assay.

r0

(numeric)
acceptable correlation coefficient of the evaluated assay.

alpha

(numeric)
type-I-risk, \(\alpha\).

power

(numeric)
Power of test, equal to 1 minus type-II-risk (\(\beta\)).

alternative

(string)
string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less".

Value

an object of size class that contains the sample size and relevant parameters.

References

Fisher (1973, p. 199).

Examples

size_corr(r1 = 0.95, r0 = 0.9, alpha = 0.025, power = 0.8, alternative = "greater")
#> 
#>  Sample size determination for testing Pearson's Correlation 
#> 
#>  Call: size_corr(r1 = 0.95, r0 = 0.9, alpha = 0.025, power = 0.8, alternative = "greater")
#> 
#>    optimal sample size: n = 64 
#> 
#>    r1:0.95 r0:0.9 alpha:0.025 power:0.8 alternative:greater