Skip to contents

[Experimental]

This function performs sample size computation for testing Pearson's correlation when a lower confidence interval is provided.

Usage

size_ci_corr(
  r,
  lr,
  alpha = 0.05,
  interval = c(10, 1e+05),
  tol = 1e-05,
  alternative = c("two.sided", "less", "greater")
)

Arguments

r

(numeric)
expected correlation coefficient of the evaluated assay.

lr

(numeric)
acceptable correlation coefficient of the evaluated assay.

alpha

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

interval

(numeric)
a numeric vector containing the end-points of the interval to be searched for the root(sample size). The defaults are set to c(1, 100000).

tol

(numeric)
tolerance for searching the root(sample size).

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_ci_corr(r = 0.9, lr = 0.85, alpha = 0.025, alternative = "greater")
#> 
#>  Sample size determination for a Given Lower Confidence Interval of Pearson's Correlation 
#> 
#>  Call: size_ci_corr(r = 0.9, lr = 0.85, alpha = 0.025, alternative = "greater")
#> 
#>    optimal sample size: n = 86 
#> 
#>    r:0.9 lr:0.85 alpha:0.025 interval:c(10, 1e+05) tol:1e-05 alternative:greater