Linear regression fits a straight line y = mx + b through a scatter of points so the vertical gaps (residuals) are as small as possible in a squared sense. That line is the usual “line of best fit” for one predictor x and one response y.
This guide covers ordinary least squares, how m and b are computed from means and sums, what R² and correlation r mean, residual checks, and careful predictions. Run any data set through the free linear regression calculator — slope, intercept, R², Pearson r, residuals, and predictions client-side.
Two-point geometry slopes are exact lines; see the slope calculator guide. Means of x and y feed the formulas — the average guide refreshes that step.