asym_test {PermCor} | R Documentation |
Large Sample Approximation (Asymptotic) Test of Correlation Coefficients
Description
This function performs a large sample approximation test of correlation coefficients, ensuring control over type I error under general scenarios when the sample size exceeds 200. It is suitable for cases where two variables are dependent but uncorrelated.
Usage
asym_test(
x,
y,
r0 = 0,
w = NULL,
method = c("Pearson", "wtdPearson", "Spearman", "CCC"),
alternative = c("two.sided", "less", "greater")
)
Arguments
x |
a |
y |
a |
r0 |
a |
w |
|
method |
the correlation coefficient to be tested, options include Pearson's correlation coefficient
( |
alternative |
the alternative hypothesis, can be |
Details
#' The test supports the following correlation coefficients: Pearson correlation coefficient, Weighted Pearson correlation coefficient, Spearman correlation coefficient, and Lin's concordance correlation coefficient (CCC)
For Pearson, weighted Pearson, and Spearman correlation coefficients, the test supports a zero null hypothesis. The alternative hypothesis can be either one-sided or two-sided.
For Lin's concordance correlation coefficient (CCC), the test accommodates a more general null hypothesis. Currently, the test only supports a one-sided alternative hypothesis (greater).
Value
estimate
the estimated correlation coefficient.
p.value
the p-value from the studentized test.
method
the method for measuring correlation coefficient.
alternative
the alternative hypothesis.
Author(s)
Mengyu Fang, Han Yu, Alan Hutson
References
Lawrence, I., & Lin, K. (1989). A concordance correlation coefficient to evaluate reproducibility. Biometrics, 255-268.
Serfling, R. J. (2009). Approximation theorems of mathematical statistics. John Wiley & Sons.
Examples
set.seed(123)
x <- rnorm(250)
y <- rnorm(250)
asym_test(x, y, method = "Pearson", alternative = "greater")
asym_test(x, y, method = "Spearman", alternative = "two.sided")
asym_test(x, y, w = rep(0.004,250), method = "wtdPearson", alternative = "less")
asym_test(x, y, r0 = -0.5, method = "CCC", alternative = "greater")