# Comparing correlation coefficients

I have two sets of data where I have at ~250.000 values for 78 and 35 samples. Some of the samples are members of a family and this may have an effect of the data. I have calculated pairwise correlation and it varies between 0.7 and 0.95 but I would like to know if there is significant difference in correlation coefficients intra vs inter family? What is the best way to do this? Thanks

## 2 Answers

A general way to compare two correlation coefficients $\hat{\rho}_{1}, \hat{\rho}_{2}$ is to use Fisher's z-transform method, which says that ${\rm arctanh}(\hat{\rho})$ is approximately normal with mean ${\rm arctanh}(\rho)$ and standard deviation $1/\sqrt{n-3}$. If the samples are independent, then you transform each correlation coefficient and the difference between the two transformed correlations will be normal with mean ${\rm arctanh}(\rho_{1})-{\rm arctanh}(\rho_{2})$ and standard deviation $\sqrt{1/(n_{1}-3) + 1/(n_{2}-3)}$. From this you can form a $z$-statistic and do testing as you would in an ordinary two-sample $z$-test.

Though @Macro's answer is nice, it does require an assumption about the (in)dependence of the statistics. Another approach would be to use bootstrapping. The idea would be to keep one one variable fixed and shuffle the other variable, calculate the correlation for each of your samples, and take their difference. Repeat many times to get a distribution and use this distribution to test the hypothesis that the correlations are the same. The structure of your data set isn't that clear to me, so it's hard to provide more details.