Here's how to calculate r, the correlation coefficient, which provides a measurement for how well a straight line fits a set of paired data.