prec_cor: Sample size or precision for correlation coefficient

Description Usage Arguments Details References

View source: R/correlation_measures.R

Description

prec_cor returns the sample size or the precision for the given pearson, spearman, or kendall correlation coefficient

Usage

1
2
3
prec_cor(r, n = NULL, conf.width = NULL, conf.level = 0.95,
  method = c("pearson", "kendall", "spearman"),
  tol = .Machine$double.eps^0.25)

Arguments

r

Desired correlation coefficient.

conf.width

precision (the full width of the conficende interval)

conf.level

confidence level

method

Exactly one of pearson (default), kendall, or spearman. Methods can be abbreviated.

tol

numerical tolerance used in root finding, the default providing (at least) four significant digits

Details

Exactly one of the parameters n, conf.width must be passed as NULL, and that parameter is determined from the other.

Sample size or precision is calculated according to formula 2 in Bonett and Wright (2000). The use of pearson is only recommended, if n ≥ 25. The pearson correlation coefficient assumes bivariate normality. If the assumption of bivariate normality cannot be met, spearman or kendall should be considered.

n is rounded up to the next whole number using ceiling.

uniroot is used to solve n.

References

Bonett DG, and Wright TA (2000) Sample size requirements for estimating Pearson, Kendall and Spearman correlations Psychometrika 65:23-28. doi:10.1007/BF02294183


a-lenz/presize documentation built on May 17, 2019, 7:44 a.m.