Correlation and the regression line

Read the strength of a correlation from r, find the mean point, set the regression line with its gradient and intercept, and predict inside the data.

Guide

correlation describes how two variables move together. The correlation coefficient r is a number from −1 to +1: near +1 the points rise in a tight line, near −1 they fall in a tight line, and near 0 there is no straight-line pattern. The sign gives the direction, the size gives the strength.

The regression line is the best straight line for predicting y from x. It always passes through the mean point (x̄, ȳ). Its gradient is m = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)² and its intercept is c = ȳ − m·x̄, so the line is y = mx + c.

Use the line to predict y for an x inside the range of the data (interpolation). Far outside the data (extrapolation) the pattern may not continue, so the prediction cannot be trusted. And a strong correlation never proves causation (cause and effect).