How to compute the correlation coefficient