Calculator Uni

Linear Regression Calculator

Fit the least-squares line through paired data with r².

Paired data

Best-fit line

y = 2.02x − 0.02

0.9982

Prediction at x = 8

16.14

Least squares in a sentence

Regression finds the line minimizing the summed squared vertical misses. The slope is the covariance of x and y over the variance of x; the intercept forces the line through the point of means. r² reports the share of y's variation the line captures.

Predict with care

Interpolation (inside the observed x range) is regression's strength; extrapolation beyond it assumes the pattern continues — the classic way forecasts fail. And a high r² doesn't validate the model shape: plot residuals to see what the line missed.

Related calculators