Linear Regression
Paste one x,y point per line.
Result
-
Enter numbers to see the result.
Slope (m)
-
Intercept (b)
-
R squared
-
Formula: m = (n sum xy - sum x sum y) / (n sum x^2 - (sum x)^2). R^2 measures explained variance.
Run a linear regression: paste x,y points for the least-squares line, R squared, and predictions.
Paste one x,y point per line.
Enter numbers to see the result.
Least squares picks the slope and intercept that minimize the sum of squared vertical gaps between the points and the line. The formulas use only five sums (x, y, x^2, xy, y^2), so the tool recomputes the line on every keystroke.
R squared is the fraction of y's variance the line explains: 1.0 is a perfect fit, 0 means the line explains nothing. The default data gives about 0.73, a solid but imperfect linear trend. Predictions beyond the data range are extrapolations: treat them with care.