Learn R Programming

psych (version 1.0-77)

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.

See Also

p.rep.r, cor.test

Examples

Run this code
paired.r(.5,.3, .4, 100) #dependent correlations
paired.r(.5,.3,NULL,100) #independent correlations same sample size
paired.r(.5,.3,NULL, 100, 64) # independent correlations, different sample sizes

Run the code above in your browser using DataLab