Linear Regression

Calculate least-squares line slope and intercept from summary statistics.

How this calculator works

Enter sum of x, sum of y, sum of xy, sum of x², number of pairs. CalcStack applies the displayed formula and reports each intermediate planning value with the units shown.

Formula / method

Slope = (nΣxy−ΣxΣy) ÷ (nΣx²−(Σx)²); intercept = (Σy−slopeΣx) ÷ n

Worked example

The entered summary statistics yield a slope of about 1.357 and intercept −0.964.

Assumptions and limitations

Paired observations are appropriately summarized and a linear relationship is meaningful.

Outliers, residual diagnostics, uncertainty and causation are not evaluated.