paired.r: Test the difference between (un)paired correlations
Description
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.
Usage
paired.r(xy, xz, yz=NULL, n, n2=NULL,twotailed=TRUE)
Arguments
xy
r(xy)
xz
r(xz)
yz
r(yz)
n
Number of subjects for first group
n2
Number of subjects in second group (if not equal to n)
twotailed
Calculate two or one tailed probability values
Value
a list containing the calculated t or z values and the associated two (or one) tailed probability.
tt test of the difference between two dependent correlations
pprobability of the t or of the z
zz test of the difference between two independent correlations
Details
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.