cocor.dep.groups.nonoverlap function

Compare two nonoverlapping correlations based on dependent groups

Compare two nonoverlapping correlations based on dependent groups

Performs a test of significance for the difference between two correlations based on dependent groups (e.g., the same group). The two correlations are nonoverlapping, i.e., they have no variable in common. The function tests whether the correlations between j and k (r.jk) and between h and m (r.hm) differ in magnitude. Because the significance depends on the pairwise intercorrelations between all of the variables involved (j, k, h, and m), these intercorrelations have to be provided as additional parameters. The function expects correlation coefficients as input.

cocor.dep.groups.nonoverlap( r.jk, r.hm, r.jh, r.jm, r.kh, r.km, n, alternative = "two.sided", test = "all", alpha = 0.05, conf.level = 0.95, null.value = 0, data.name = NULL, var.labels = NULL, return.htest = FALSE )

Arguments

  • r.jk: A number specifying the correlation between jj and kk (this correlation is used for comparison)
  • r.hm: A number specifying the correlation between hh and mm (this correlation is used for comparison)
  • r.jh: A number specifying the correlation between jj and hh
  • r.jm: A number specifying the correlation between jj and mm
  • r.kh: A number specifying the correlation between kk and hh
  • r.km: A number specifying the correlation between kk and mm
  • n: An integer defining the size of the group
  • alternative: A character string specifying whether the alternative hypothesis is two-sided ("two.sided"; default) or one-sided ("greater" or "less", depending on the direction). Optionally, the initial letter of the character strings ("t", "g", and "l)" can be used.
  • test: A vector of character strings specifying the tests to be used (pearson1898, dunn1969, steiger1980, raghunathan1996, silver2004, or zou2007). Use all to apply all tests (default). For further information see the tests section below.
  • alpha: A number defining the alpha level for the hypothesis test. The default value is .05.05.
  • conf.level: A number defining the level of confidence for the confidence interval (if test zou2007 is used). The default value is .95.95.
  • null.value: A number defining the hypothesized difference between the two correlations used for testing the null hypothesis. The default value is 00. If the value is other than 00, only the test zou2007 that uses a confidence interval is available.
  • data.name: A character string giving the name of the data/group.
  • var.labels: A vector of four character strings specifying the labels for j, k, h, and m (in this order).
  • return.htest: A logical indicating whether the result should be returned as a list containing a list of class 'htest' for each test. The default value is FALSE.

Returns

Returns an S4 object of class 'cocor.dep.groups.nonoverlap' with the following slots: - r.jk: Input parameter

  • r.hm: Input parameter

  • r.jh: Input parameter

  • r.jm: Input parameter

  • r.kh: Input parameter

  • r.km: Input parameter

  • n: Input parameter

  • alternative: Input parameter

  • alpha: Input parameter

  • conf.level: Input parameter

  • null.value: Input parameter

  • data.name: Input parameter

  • var.labels: Input parameter

  • diff: Difference between the two correlations, r.jk and r.hm, that were compared

For each test a slot of the same name exists with a list containing the following elements: - statistic: The value of the test statistic (unless test zou2007 is used).

  • distribution: The distribution of the test statistic (unless test zou2007 is used).

  • p.value: The p-value of the test (unless test zou2007 is used).

  • conf.int: The confidence interval of the difference between the two correlations (if test zou2007 is used).

Tests

In the following, rjkr_{jk} and rhmr_{hm} are the two correlations that are being compared; ZjkZ_{jk} and ZhmZ_{hm} are their ZZ transformed equivalents. rjhr_{jh}, rkhr_{kh}, rjmr_{jm}, and rkmr_{km} are the related correlations that are also required. nn specifies the size of the group the two correlations are based on. Some tests make use of Fisher's rr-to-ZZ transformation (1921, p. 26):

Z=12(ln(1+r)ln(1r)).Z=(1/2)(ln(1+r)ln(1r)). Z = \frac{1}{2}(ln(1+r) - ln(1-r)).Z = (1/2)(ln(1+r) - ln(1-r)).
  • pearson1898:: Pearson and Filon's (1898) z

     This test was proposed by Pearson and Filon (1898, p. 262, formula xl). The formula for the test statistic $z$ is computed as 
    
z=n(rjkrhm)(1rjk2)2+(1rhm2)2kz=((n)(rjkrhm))/(((1rjk2)2+(1rhm2)2k)) z = \frac{\sqrt{n} (r_{jk} - r_{hm})}{\sqrt{(1 - r_{jk}^2)^2 + (1 - r_{hm}^2)^2 - k}}z = (\sqrt(n) (r_{jk} - r_{hm}))/(\sqrt((1 - r_{jk}^2)^2 + (1 - r_{hm}^2)^2 - k))
   (Raghunathan, Rosenthal, and Rubin, 1996, p. 179, formula 1), where 
k=(rjhrjkrkh)(rkmrkhrhm)+(rjmrjhrhm)(rkhrjkrjh) k = (r_{jh} - r_{jk} r_{kh}) (r_{km} - r_{kh} r_{hm}) + (r_{jm} - r_{jh} r_{hm}) (r_{kh} - r_{jk} r_{jh}) +(rjhrjmrhm)(rkmrjkrjm)+(rjmrjkrkm)(rkhrkmrhm) + (r_{jh} - r_{jm} r_{hm}) (r_{km} - r_{jk} r_{jm}) + (r_{jm} - r_{jk} r_{km}) (r_{kh} - r_{km} r_{hm})
   (Raghunathan et al. (1996, p. 179, formula 2). The two formulae can also be found in Steiger (1980, p. 245, formula 2 and p. 246, formula 5).
  • dunn1969:: Dunn and Clark's (1969) z

     The test statistic $z$ of this test is calculated as 
    
z=(ZjkZhm)n322cz=((ZjkZhm)(n3))/((22c)) z = \frac{(Z_{jk} - Z_{hm})\sqrt{n - 3}}{\sqrt{2 - 2c}}z = ((Z_{jk} - Z_{hm})\sqrt(n - 3))/(\sqrt(2 - 2c))
   (Dunn and Clark, 1969, p. 370, formula 15), where 
c=(12rjkrhm(rjh2+rjm2+rkh2+rkm2)+rjhrkm+rjmrkhc=((1/2)rjkrhm(rjh2+rjm2+rkh2+rkm2)+rjhrkm+rjmrkh c = \Bigl(\frac{1}{2} r_{jk} r_{hm} (r_{jh}^2 + r_{jm}^2 + r_{kh}^2 + r_{km}^2) + r_{jh} r_{km} + r_{jm} r_{kh}c = ((1/2) r_{jk} r_{hm} (r_{jh}^2 + r_{jm}^2 + r_{kh}^2 + r_{km}^2) + r_{jh} r_{km} + r_{jm} r_{kh} (rjkrjhrjm+rjkrkhrkm+rjhrkhrhm+rjmrkmrhm))(rjkrjhrjm+rjkrkhrkm+rjhrkhrhm+rjmrkmrhm)) - (r_{jk} r_{jh} r_{jm} + r_{jk} r_{kh} r_{km} + r_{jh} r_{kh} r_{hm} + r_{jm} r_{km} r_{hm})\Bigr)- (r_{jk} r_{jh} r_{jm} + r_{jk} r_{kh} r_{km} + r_{jh} r_{kh} r_{hm} + r_{jm} r_{km} r_{hm})) /((1rjk2)(1rhm2))/((1rjk2)(1rhm2)) \Big/ \Bigl((1 - r_{jk}^2)(1 - r_{hm}^2)\Bigr)/((1 - r_{jk}^2)(1 - r_{hm}^2))
   (Dunn and Clark, 1969, p. 368, formula 9).
  • steiger1980:: Steiger's (1980) modification of Dunn and Clark's (1969) z using average correlations

     This test was proposed by Steiger (1980) and is a modification of Dunn and Clark's (1969) $z$. Instead of $r_{jk}$ and $r_{hm}$ the mean of the two is being used. The test statistic $z$ is given by 
    
z=(ZjkZhm)n322cz=((ZjkZhm)(n3))/((22c)) z = \frac{(Z_{jk} - Z_{hm})\sqrt{n - 3}}{\sqrt{2 - 2c}}z = ((Z_{jk} - Z_{hm})\sqrt(n - 3))/(\sqrt(2 - 2c))
   (Steiger, 1980, p. 247, formula 15), where 
rˉ=rjk+rhm2rˉ=(rjk+rhm)/2 \bar r = \frac{r_{jk} + r_{hm}}{2}\bar{r} = (r_{jk} + r_{hm})/2
   (Steiger, 1980, p. 247) and 
c=12rˉ2(rjh2+rjm2+rkh2+rkm2)+rjhrkm+rjmrkh(rˉrjhrjm+rˉrkhrkm+rjhrkhrˉ+rjmrkmrˉ)(1rˉ2)2c=((1/2)rˉ2(rjh2+rjm2+rkh2+rkm2)+rjhrkm+rjmrkh(rˉrjhrjm+rˉrkhrkm+rjhrkhrˉ+rjmrkmrˉ))/((1rˉ2)2) c = \frac{\frac{1}{2} \bar r^2 (r_{jh}^2 + r_{jm}^2 + r_{kh}^2 + r_{km}^2) + r_{jh} r_{km} + r_{jm} r_{kh} - (\bar r r_{jh} r_{jm} + \bar r r_{kh} r_{km} + r_{jh} r_{kh} \bar r + r_{jm} r_{km} \bar r)}{(1 - \bar r^2)^2}c = ((1/2) \bar{r}^2 (r_{jh}^2 + r_{jm}^2 + r_{kh}^2 + r_{km}^2) + r_{jh} r_{km} + r_{jm} r_{kh} - (\bar{r} r_{jh} r_{jm} + \bar{r} r_{kh} r_{km} + r_{jh} r_{kh} \bar{r} + r_{jm} r_{km} \bar{r}))/((1 - \bar{r}^2)^2)
   (Steiger, 1980, p. 247, formula 11; in the original article, there are brackets missing around the divisor).
  • raghunathan1996:: Raghunathan, Rosenthal, and Rubin's (1996) modification of Pearson and Filon's (1898) z

     This test of Raghunathan, Rosenthal, and Rubin (1996) is based on Pearson and Filon's (1898) $z$. Unlike Pearson and Filon (1898), Raghunathan et al. (1996) use $Z$ transformed correlation coefficients. The test statistic $z$ is computed as 
    
z=n32ZjkZhm1k2(1rjk2)(1rhm2)z=((n3)/2)(ZjkZhm)/((1k/(2(1rjk2)(1rhm2)))) z = \sqrt{\frac{n - 3}{2}} \frac{Z_{jk} - Z_{hm}}{\sqrt{1 - \frac{k}{2(1 - r_{jk}^2)(1 - r_{hm}^2)}}}z = \sqrt((n - 3)/2)(Z_{jk} - Z_{hm})/(\sqrt(1 - k/(2(1 - r_{jk}^2)(1 - r_{hm}^2))))
   (Raghunathan et al., 1996, p. 179, formula 3), where 
k=(rjhrjkrkh)(rkmrkhrhm)+(rjmrjhrhm)(rkhrjkrjh) k = (r_{jh} - r_{jk} r_{kh}) (r_{km} - r_{kh} r_{hm}) + (r_{jm} - r_{jh} r_{hm}) (r_{kh} - r_{jk} r_{jh}) +(rjhrjmrhm)(rkmrjkrjm)+(rjmrjkrkm)(rkhrkmrhm) + (r_{jh} - r_{jm} r_{hm}) (r_{km} - r_{jk} r_{jm}) + (r_{jm} - r_{jk} r_{km}) (r_{kh} - r_{km} r_{hm})
   (Raghunathan et al., 1996, p. 179, formula 2).
  • silver2004:: Silver, Hittner, and May's (2004) modification of Dunn and Clark's (1969) z using a backtransformed average Fisher's (1921) Z procedure

     The approach to backtransform averaged Fisher's (1921) $Z$s was first proposed in Silver and Dunlap (1987) and was applied to the comparison of nonoverlapping correlations by Silver et al. (2004). The test is based on Steiger's (1980) approach. The formula of the test statistic $z$ is given by 
    
z=(ZjkZhm)n322cz=((ZjkZhm)(n3))/((22c)) z = \frac{(Z_{jk} - Z_{hm})\sqrt{n - 3}}{\sqrt{2 - 2c}}z = ((Z_{jk} - Z_{hm})\sqrt(n - 3))/(\sqrt(2 - 2c))
   (Silver et al., 2004, p. 55, formula 5), where 
c=12rˉz2(rjh2+rjm2+rkh2+rkm2)+rjhrkm+rjmrkh(rˉzrjhrjm+rˉzrkhrkm+rjhrkhrˉz+rjmrkmrˉz)(1rˉz2)2c=((1/2)rˉz2(rjh2+rjm2+rkh2+rkm2)+rjhrkm+rjmrkh(rˉzrjhrjm+rˉzrkhrkm+rjhrkhrˉz+rjmrkmrˉz))/((1rˉz2)2) c = \frac{\frac{1}{2} \bar r_z^2 (r_{jh}^2 + r_{jm}^2 + r_{kh}^2 + r_{km}^2) + r_{jh} r_{km} + r_{jm} r_{kh} - (\bar r_z r_{jh} r_{jm} + \bar r_z r_{kh} r_{km} + r_{jh} r_{kh} \bar r_z + r_{jm} r_{km} \bar r_z)}{(1 - \bar r_z^2)^2}c = ((1/2) \bar{r}_z^2 (r_{jh}^2 + r_{jm}^2 + r_{kh}^2 + r_{km}^2) + r_{jh} r_{km} + r_{jm} r_{kh} - (\bar{r}_z r_{jh} r_{jm} + \bar{r}_z r_{kh} r_{km} + r_{jh} r_{kh} \bar{r}_z + r_{jm} r_{km} \bar{r}_z))/((1 - \bar{r}_z^2)^2)
   (Silver et al., 2004, p. 56), 
rˉz=exp(2Zˉ1)exp(2Zˉ+1)rˉz=(exp(2Zˉ1))/(exp(2Zˉ+1)) \bar r_z = \frac{exp(2\bar Z - 1)}{exp(2\bar Z + 1)}\bar{r}_z = (exp(2\bar{Z} - 1))/(exp(2\bar{Z} + 1))
   (Silver and Dunlap, 1987, p. 146, formula 4), and 
Zˉ=Zjk+Zhm2Zˉ=(Zjk+Zhm)/2 \bar Z = \frac{Z_{jk} + Z_{hm}}{2}\bar{Z} = (Z_{jk} + Z_{hm})/2
   (Silver et al., 2004, p. 55).
  • zou2007:: Zou's (2007) confidence interval

     This test calculates the confidence interval of the difference between the two correlations $r_{jk}$ and $r_{hm}$. If the confidence interval includes zero, the null hypothesis that the two correlations are equal must be retained. If the confidence interval does not include zero, the null hypothesis has to be rejected. A lower and upper bound for the interval ($L$ and $U$, respectively) is given by 
    
L=rjkrhm(rjkl1)2+(u2rhm)22c(rjkl1)(u2rhm)L=rjkrhm((rjkl1)2+(u2rhm)22c(rjkl1)(u2rhm)) L = r_{jk} - r_{hm} - \sqrt{(r_{jk} - l_1)^2 + (u_2 - r_{hm})^2 - 2c(r_{jk} - l_1)(u_2 - r_{hm})}L = r_{jk} - r_{hm} - \sqrt((r_{jk} - l_1)^2 + (u_2 - r_{hm})^2 - 2c(r_{jk} - l_1)(u_2 - r_{hm}))
   and 
U=rjkrhm+(u1rjk)2+(rhml2)22c(u1rjk)(rhml2)U=rjkrhm+((u1rjk)2+(rhml2)22c(u1rjk)(rhml2)) U = r_{jk} - r_{hm} + \sqrt{(u_1 - r_{jk})^2 + (r_{hm} - l_2)^2 - 2c(u_1 - r_{jk})(r_{hm} - l_2)}U = r_{jk} - r_{hm} + \sqrt((u_1 - r_{jk})^2 + (r_{hm} - l_2)^2 - 2c(u_1 - r_{jk})(r_{hm} - l_2))
   (Zou, 2007, pp. 409-410), where 
l=exp(2l)1exp(2l)+1,l=(exp(2l)1)/(exp(2l)+1), l = \frac{exp(2l') - 1}{exp(2l') + 1},l = (exp(2l') - 1)/(exp(2l') + 1), u=exp(2u)1exp(2u)+1u=(exp(2u)1)/(exp(2u)+1) u = \frac{exp(2u') - 1}{exp(2u') + 1}u = (exp(2u') - 1)/(exp(2u') + 1)
   (Zou, 2007, p. 406), 
c=(12rjkrhm(rjh2+rjm2+rkh2+rkm2)+rjhrkm+rjmrkhc=((1/2)rjkrhm(rjh2+rjm2+rkh2+rkm2)+rjhrkm+rjmrkh c = \Bigl(\frac{1}{2} r_{jk} r_{hm} (r_{jh}^2 + r_{jm}^2 + r_{kh}^2 + r_{km}^2) + r_{jh} r_{km} + r_{jm} r_{kh}c = ((1/2) r_{jk} r_{hm} (r_{jh}^2 + r_{jm}^2 + r_{kh}^2 + r_{km}^2) + r_{jh} r_{km} + r_{jm} r_{kh} (rjkrjhrjm+rjkrkhrkm+rjhrkhrhm+rjmrkmrhm))(rjkrjhrjm+rjkrkhrkm+rjhrkhrhm+rjmrkmrhm)) - (r_{jk} r_{jh} r_{jm} + r_{jk} r_{kh} r_{km} + r_{jh} r_{kh} r_{hm} + r_{jm} r_{km} r_{hm})\Bigr)- (r_{jk} r_{jh} r_{jm} + r_{jk} r_{kh} r_{km} + r_{jh} r_{kh} r_{hm} + r_{jm} r_{km} r_{hm})) /((1rjk2)(1rhm2))/((1rjk2)(1rhm2)) \Big/ \Bigl((1 - r_{jk}^2)(1 - r_{hm}^2)\Bigr)/((1 - r_{jk}^2)(1 - r_{hm}^2))
   (Zou, 2007, p. 409), and 
l,u=Z±zα21n3l,u=Z+zα/2(1/(n3)) l',u' = Z \pm z_{\frac{\alpha}{2}} \sqrt{\frac{1}{n - 3}}l',u' = Z +- z_{\alpha/2} \sqrt(1/(n - 3))
   (Zou, 2007, p. 406). $\alpha$ denotes the desired alpha level of the confidence interval.

Examples

# Compare the difference between the correlations (age, intelligence) and # body mass (index, shoe size) measured in the same group (all values are fictional): r.jk <- .2 # Correlation (age, intelligence) r.hm <- .7 # Correlation (body mass index, shoe size) r.jh <- .4 # Correlation (age, body mass index) r.jm <- .5 # Correlation (age, shoe size) r.kh <- .1 # Correlation (intelligence, body mass index) r.km <- .3 # Correlation (intelligence, shoe size) n <- 232 # Size of the group cocor.dep.groups.nonoverlap(r.jk, r.hm, r.jh, r.jm, r.kh, r.km, n, var.labels=c("age", "intelligence", "body mass index", "shoe size"))

References

Dunn, O. J., & Clark, V. A. (1969). Correlation coefficients measured on the same individuals. Journal of the American Statistical Association, 64, 366-377. doi:10.2307/2283746

Pearson, K., & Filon, L. N. G. (1898). Mathematical contributions to theory of evolution: IV. On the probable errors of frequency constants and on the influence of random selection and correlation. Philosophical Transactions of the Royal Society of London, Series A, 191, 229-311. doi:10.1098/rsta.1898.0007

Raghunathan, T. E., Rosenthal, R., & Rubin, D. B., (1996). Comparing correlated but nonoverlapping correlations. Psychological Methods, 1, 178-183. doi:10.1037//1082-989X.1.2.178

Silver, N. C., & Dunlap, W. P. (1987). Averaging correlation coefficients: Should Fisher's Z transformation be used? Journal of Applied Psychology, 72, 146-148. doi:10.1037//0021-9010.72.1.146

Silver, N. C., Hittner, J. B., & May, K. (2004). Testing dependent correlations with nonoverlapping variables: A Monte Carlo simulation. Journal of Experimental Education, 73, 53-69. doi:10.3200/JEXE.71.1.53-70

Steiger, J. H. (1980). Tests for comparing elements of a correlation matrix. Psychological Bulletin, 87, 245-251. doi:10.1037//0033-2909.87.2.245

Zou, G. Y. (2007). Toward using confidence intervals to compare correlations. Psychological Methods, 12, 399-413. doi:10.1037/1082-989X.12.4.399

See Also

cocor , cocor.indep.groups , cocor.dep.groups.overlap , as.htest