Least-Squares Regression Line from Running Sums Calculator
slope = (n·Σxy − Σx·Σy) / (n·Σx² − (Σx)²); intercept = (Σy − slope·Σx) / n.
Fit an ordinary least-squares regression line y = m·x + b directly from the standard running sums Σx, Σy, Σxy, Σx², and the sample size n: slope = (n·Σxy − Σx·Σy) / (n·Σx² − (Σx)²); intercept = (Σy − slope·Σx) / n. Useful when raw observations have already been streamed/aggregated.
How to use this calculator
- Fill in the inputs above using the units you already have.
- Values update automatically as you type — no submit button needed.
- Hover any result row for the underlying formula and intermediate values.
Formula
slope = (n·Σxy − Σx·Σy) / (n·Σx² − (Σx)²); intercept = (Σy − slope·Σx) / n.
In depth
Fit an ordinary least-squares regression line y = m·x + b directly from the standard running sums Σx, Σy, Σxy, Σx², and the sample size n: slope = (n·Σxy − Σx·Σy) / (n·Σx² − (Σx)²); intercept = (Σy − slope·Σx) / n. Useful when raw observations have already been streamed/aggregated.
Spot an issue or have a suggestion?
Our editors read every message. If the math looks off, tell us the inputs you used and what you expected.