paired.r: Test the difference between (un)paired correlations
Test the difference between two (paired or unpaired) correlations. Given 3 variables, x, y, z, is the correlation between xy different than that between xz? If y and z are independent, this is a simple t-test of the z transformed rs. But, if they are dependent, it is a bit more complicated.
paired.r(xy, xz, yz=NULL, n, n2=NULL,twotailed=TRUE)
Number of subjects for first group
Number of subjects in second group (if not equal to n)
Calculate two or one tailed probability values
a list containing the calculated t or z values and the associated two (or one) tailed probability.
t test of the difference between two dependent correlations
probability of the t or of the z
z test of the difference between two independent correlations
To find the z of the difference between two independent correlations, first convert them to z scores using the Fisher r-z transform and then find the z of the difference between the two correlations. The default assumption is that the group sizes are the same, but the test can be done for different size groups by specifying n2.
If the correlations are not independent (i.e., they are from the same sample) then the correlation with the third variable r(yz) must be specified. Find a t statistic for the difference of thee two dependent correlations.
r.test for more tests of independent as well as dependent (paired) tests. p.rep.r for the probability of replicating a particular correlation.
cor.test from stats for testing a single correlation and corr.test for finding the values and probabilities of multiple correlations. See also set.cor to do multiple correlations from matrix input.