cordiff.dep: Function to estimate whether two dependent correlations...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This function tests for statistical differences between two dependent correlations using the formula provided on page 56 of Cohen & Cohen (1983). The function returns a t-value, the DF and the p-value.

Usage

1
2
cordiff.dep(r.x1y, r.x2y, r.x1x2, n,
  alternative = c("two.sided", "less", "greater"))

Arguments

r.x1y

The correlation between x1 and y where y is typically your outcome variable.

r.x2y

The correlation between x2 and y where y is typically your outcome variable.

r.x1x2

The correlation between x1 and x2 (the correlation between your two predictors).

n

The sample size.

alternative

A character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter.

Details

This function is inspired from the cordif.dep.

Value

Vector of three values: t statistics, degree of freedom, and p-value.

Author(s)

Benjamin Haibe-Kains

References

Cohen, J. & Cohen, P. (1983) "Applied multiple regression/correlation analysis for the behavioral sciences (2nd Ed.)" Hillsdale, nJ: Lawrence Erlbaum Associates.

See Also

cor, t.test, compareProtoCor

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## load VDX dataset
data(vdxs)
## retrieve ESR1, AURKA and MKI67 gene expressions
x1 <- data.vdxs[ ,"208079_s_at"]
x2 <- data.vdxs[ ,"205225_at"]
y <- data.vdxs[ ,"212022_s_at"]
## is MKI67 significantly more correlated to AURKA than ESR1?
cc.ix <- complete.cases(x1, x2, y)
cordiff.dep(r.x1y=abs(cor(x=x1[cc.ix], y=y[cc.ix], use="everything",
  method="pearson")), r.x2y=abs(cor(x=x2[cc.ix], y=y[cc.ix],
  use="everything", method="pearson")), r.x1x2=abs(cor(x=x1[cc.ix],
  y=x2[cc.ix], use="everything", method="pearson")), n=sum(cc.ix),
  alternative="greater")

genefu documentation built on Jan. 28, 2021, 2:01 a.m.