# Significance of the difference between two correlation coefficients

6 messages
Open this post in threaded view
|

## Significance of the difference between two correlation coefficients

 Hi, based on the sample size I want to calculate whether to correlation coefficients are significantly different or not. I know that as a first step both coefficients have to be converted to z values using fisher's z transformation. I have done this already but I dont know how to further proceed from there. unlike for correlation coefficients I know that the difference for z values is mathematically defined but I do not know how to incorporate the sample size. I found a couple of websites that provide that service but since I have huge data sets I need to automate this procedure. (http://faculty.vassar.edu/lowry/rdiff.html) Can anyone help? Cheers, syrvn
Open this post in threaded view
|

## Re: Significance of the difference between two correlation coefficients

 Thanks for providing the example but it would be useful to know who I am communicating with or from which institute, but nevermind ... I don't know much about this subject but a quick google search gives me the following site: http://davidmlane.com/hyperstat/A50760.htmlUsing the info from that website, I can code up the following to give the two-tailed p-value of difference in correlations:   diff.corr <- function( r1, n1, r2, n2 ){     Z1 <- 0.5 * log( (1+r1)/(1-r1) )     Z2 <- 0.5 * log( (1+r2)/(1-r2) )     diff   <- Z1 - Z2     SEdiff <- sqrt( 1/(n1 - 3) + 1/(n2 - 3) )     diff.Z  <- diff/SEdiff     p <- 2*pnorm( abs(diff.Z), lower=F)     cat( "Two-tailed p-value", p , "\n" )   }   diff.corr( r1=0.5, n1=100, r2=0.40, n2=80 )   ## Two-tailed p-value 0.4103526   diff.corr( r1=0.1, n1=100, r2=-0.1, n2=80 )   ## Two-tailed p-value 0.1885966 The p-value here is slightly different from the Vassar website because the website rounds it's "diff.Z" values to 2 digits. Regards, Adai On 29/11/2010 15:30, syrvn wrote: > > Hi, > > based on the sample size I want to calculate whether to correlation > coefficients are significantly different or not. I know that as a first step > both coefficients > have to be converted to z values using fisher's z transformation. I have > done this already but I dont know how to further proceed from there. > > unlike for correlation coefficients I know that the difference for z values > is mathematically defined but I do not know how to incorporate the sample > size. > > I found a couple of websites that provide that service but since I have huge > data sets I need to automate this procedure. > > (http://faculty.vassar.edu/lowry/rdiff.html) > > Can anyone help? > > Cheers, > syrvn > ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: Significance of the difference between two correlation coefficients

 Hi, thanks a lot. that's what i tried to figure out! it works great and is exactly what i need. Best, syrvn
Open this post in threaded view
|