CorDiffCI.RdCorDiffCI calculates a confidence interval for the difference of two independent correlation coefficients.
CorDiffCI(R1, R2, N1, N2 = N1, CONF.LEVEL = 0.95, DIGITS = 3)
| R1 | estimate of first correlation coefficient |
|---|---|
| R2 | estimate of second correlation coefficient |
| N1 | number of valid values for R1 |
| N2 | =N1 number of valid values for R2 |
| CONF.LEVEL | =0.95 desired confidence level |
| DIGITS | =3 Number of digits for correlation difference |
data.frame of R1, OR, CorDiff, Lower and Upper
if (FALSE) { CorDiffCI(.49,.36,145,87,CONF.LEVEL=.95) ## Example from Zou 2007 reproduced x<-c(rnorm(50),rnorm(50,5)) y<-c(rnorm(50),rnorm(50,5)+10*x[51:100])*2 Split<-factor(paste("Group",rep(LETTERS[1:2],each=50),sep="-")) ScatterPlot(x,y,SPLIT=Split) CorDiffCI(cor(x[Split=="Group-A"],y[Split=="Group-A"]), cor(x[Split=="Group-B"],y[Split=="Group-B"]), 50,50) }