compOverlapCorr       package:compOverlapCorr       R Documentation

_C_o_m_p_a_r_i_n_g _o_v_e_r_l_a_p_p_i_n_g _c_o_r_r_e_l_a_t_i_o_n _c_o_e_f_f_i_c_i_e_n_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     This package contains function to test the difference between two
     overlapping (in the sense of having a variable in common)
     correlation coefficients, using a Z-test as described by Meng,
     Rosenthal, and Rubin (Meng et al, 1992).

_U_s_a_g_e:

     compOverlapCorr(N, r13, r23, r12)

_A_r_g_u_m_e_n_t_s:

       N: the sample size 

     r13: the correlation coefficient between the two variables, X1 and
          Y 

     r23: the correlation coefficient between the two variables, X2 and
          Y 

     r12: the correlation coefficient between the two variables, X1 and
          X2 

_V_a_l_u_e:

  comp1 : the Z-score generated using the Meng-Rosenthal-Rubin method

  comp2 : the P-value, two-tailed, for the difference between r13 and
          r23

_A_u_t_h_o_r(_s):

     Ka-Loh Li <ka-loh.li@radiology.ucsf.edu>, and Xiaoping Zhu
     <Xiaoping.Zhu@ucsf.edu>

_R_e_f_e_r_e_n_c_e_s:

     Meng X-L, Rosenthal R, Rubin DB. Comparing correlated correlation
     coefficients. Psychological bulletin 1992;111(1):172-175.

_E_x_a_m_p_l_e_s:

     resul <- compOverlapCorr(15, 0.63, -0.03, -0.19)

     ## The function is currently defined as
     function(N, r13, r23, r12){
     # Meng-Rosenthal-Rubin method 
     # comparing two correlated correlation coefficients (r13, r23)
     # N is the number of subjects
     # r13 is the correlation coefficient between variables X1 and Y
     # r23 is the correlation coefficient between variables X2 and Y 
     # r12 is the correlation coefficient between variables X1 and X2 
     # return difference and two-tailed p-value as list(diff, pval) 

     # Fisher Z-transform 
       zf1 <- 0.5*log((1 + r13)/(1 - r13)) 
       zf2 <- 0.5*log((1 + r23)/(1 - r23))

     # difference
       r2mean <- (r13^2 + r23^2)/2.0
       f <- (1-r12)/(2*(1-r2mean))
       if(f > 1.0) 
             {
             f <- 1.0
             }
       h <- (1-f*r2mean)/(1-r2mean)
       dz <- (zf1 - zf2)*sqrt((N-3)/(2*(1-r12)*h))

     # two-tailed p-value 
       pv <- 2*(1 - pnorm(abs(dz)))
       #pv <- 1 - pnorm(abs(dz))
       return(as.numeric(list(diff=dz, pval=pv))) 
       }

