Hypothesis test for equality of two correlation coefficients {corrfuns} | R Documentation |
Hypothesis test for equality of two correlation coefficients
Description
Hypothesis test for equality of two correlation coefficients.
Usage
correls2.test(r1, r2, n1, n2, type = "pearson")
Arguments
r1 |
The value of the first correlation coefficient. |
r2 |
The value of the second correlation coefficient. |
n1 |
The sample size of the first sample from which the first correlation coefficient was computed. |
n2 |
The sample size of the second sample from which the first correlation coefficient was computed. |
type |
The type of correlation coefficients, "pearson" or "spearman". |
Details
The test statistic for the hypothesis of equality of two correlation coefficients is the following:
where and
denote the Fisher's transformation (see
correl
applied to the two correlation coefficients and and
denote the sample sizes of the two correlation coefficients. The denominator is the sum of the variances of the two coefficients and as you can see we used a different variance estimator than the one we used before. This function performs hypothesis testing for the equality of two correlation coefficients. The result is the calculated p-value from the standard normal distribution.
Value
The test statistic and its associated p-value for the test of equal correlations.
Author(s)
Michail Tsagris
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
See Also
Examples
y <- rnorm(40)
x <- matrix(rnorm(40 * 1000), ncol = 1000)
a <- correls(y, x )