basic

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.

Published Last reviewed 1 min read

Inputs

Results

Enter values and click Calculate to see results.
Was this helpful?

How to use this calculator

  1. Fill in the inputs above using the units you already have.
  2. Values update automatically as you type — no submit button needed.
  3. 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.