cocor.dep.groups.nonoverlap: Compare two nonoverlapping correlations based on dependent...

View source: R/cocor.dep.groups.nonoverlap.r

cocor.dep.groups.nonoverlapR Documentation

Compare two nonoverlapping correlations based on dependent groups

Description

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.

Usage

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 j and k (this correlation is used for comparison)

r.hm

A number specifying the correlation between h and m (this correlation is used for comparison)

r.jh

A number specifying the correlation between j and h

r.jm

A number specifying the correlation between j and m

r.kh

A number specifying the correlation between k and h

r.km

A number specifying the correlation between k and m

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.

conf.level

A number defining the level of confidence for the confidence interval (if test zou2007 is used). The default value is .95.

null.value

A number defining the hypothesized difference between the two correlations used for testing the null hypothesis. The default value is 0. If the value is other than 0, 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.

Value

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, r_{jk} and r_{hm} are the two correlations that are being compared; Z_{jk} and Z_{hm} are their Z transformed equivalents. r_{jh}, r_{kh}, r_{jm}, and r_{km} are the related correlations that are also required. n specifies the size of the group the two correlations are based on. Some tests make use of Fisher's r-to-Z transformation (1921, p. 26):

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) (r_{jk} - r_{hm}))/(√((1 - r_{jk}^2)^2 + (1 - r_{hm}^2)^2 - k))

(Raghunathan, Rosenthal, and Rubin, 1996, p. 179, formula 1), where

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})

+ (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 = ((Z_{jk} - Z_{hm})√(n - 3))/(√(2 - 2c))

(Dunn and Clark, 1969, p. 370, formula 15), where

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}

- (r_{jk} r_{jh} r_{jm} + r_{jk} r_{kh} r_{km} + r_{jh} r_{kh} r_{hm} + r_{jm} r_{km} r_{hm}))

/((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 = ((Z_{jk} - Z_{hm})√(n - 3))/(√(2 - 2c))

(Steiger, 1980, p. 247, formula 15), where

\bar{r} = (r_{jk} + r_{hm})/2

(Steiger, 1980, p. 247) and

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 = √((n - 3)/2)(Z_{jk} - Z_{hm})/(√(1 - k/(2(1 - r_{jk}^2)(1 - r_{hm}^2))))

(Raghunathan et al., 1996, p. 179, formula 3), where

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})

+ (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) Zs 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 = ((Z_{jk} - Z_{hm})√(n - 3))/(√(2 - 2c))

(Silver et al., 2004, p. 55, formula 5), where

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),

\bar{r}_z = (exp(2\bar{Z} - 1))/(exp(2\bar{Z} + 1))

(Silver and Dunlap, 1987, p. 146, formula 4), and

\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 = r_{jk} - r_{hm} - √((r_{jk} - l_1)^2 + (u_2 - r_{hm})^2 - 2c(r_{jk} - l_1)(u_2 - r_{hm}))

and

U = r_{jk} - r_{hm} + √((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') - 1)/(exp(2l') + 1),

u = (exp(2u') - 1)/(exp(2u') + 1)

(Zou, 2007, p. 406),

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}

- (r_{jk} r_{jh} r_{jm} + r_{jk} r_{kh} r_{km} + r_{jh} r_{kh} r_{hm} + r_{jm} r_{km} r_{hm}))

/((1 - r_{jk}^2)(1 - r_{hm}^2))

(Zou, 2007, p. 409), and

l', u' = Z +- z_{α/2} √(1/(n - 3))

(Zou, 2007, p. 406). α denotes the desired alpha level of the confidence interval.

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

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"))


cocor documentation built on June 28, 2022, 5:06 p.m.