How to calculate the correlation coefficient