psych (version 1.0-17)

paired.r: Test the difference between paired correlations

Description

Test the difference between paired 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. But, if they are dependent, it is a bit more complicated.

Usage

paired.r(xy, xz, yz, n)

Arguments

xy
r(xy)
xz
r(xz)
yz
r(yz)
n
Number of subjects

Value

  • t2

Details

Find a t2 statistic for the difference of two dependent correlations.

Examples

Run this code
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function(xy,xz,yz,n) {
       diff <- xy-xz
       determin=1-xy*xy - xz*xz - yz*yz + 2*xy*xz*yz
       av=(xy+xz)/2
       cube= (1-yz)*(1-yz)*(1-yz)
       t2 = diff * sqrt((n-1)*(1+yz)/(((2*(n-1)/(n-3))*determin+av*av*cube)))
       return(t2)
        }

Run the code above in your browser using DataLab