Fits the line y = ax + b that best matches the points by least squares. The slope is the covariance ÷ the variance of x, and the intercept is ȳ − a·x̄. R² measures how well the line fits.
A regression line is the straight line that best fits a cloud of points. "Best" means that the sum of the squared vertical gaps between the points and the line is as small as possible — the method of least squares.
The slope is the covariance divided by the variance of . The intercept follows from the fact that the line always passes through the point .
With = 1, 2, 3, 4, 5 and = 2, 4, 5, 4, 5, we have , , a covariance of 1.2 and a variance of equal to 2.
The regression line is , so an of 6 predicts a of 5.8.
The coefficient of determination is the square of the correlation coefficient. It is the share of the variation in that the line accounts for.
Here , so : the line explains 60% of the variation in .