How to compute correlation coefficient