Simple linear regression calculator

Calculate slope and intercept with your own figures.

Your numbers

Use the units shown. Results update as you change valid inputs.

Use slope and intercept to compare changes to your inputs. The method and limits below explain the scope.

Examples

Examples

Try the starting example

X observations
1,2,3
Y observations
2,4,6
Slope
2
Intercept
0
R squared
1

Try another scenario

X observations
2,4,6
Y observations
2,4,6
Slope
1
Intercept
0
R squared
1
Calculation method

Calculation method

Slope

From matched pairs, calculate Sxx = sum((x−mean x)^2), Syy = sum((y−mean y)^2) and Sxy = sum((x−mean x) × (y−mean y)). Slope = Sxy/Sxx.

Intercept

Intercept = mean y − slope × mean x.

R squared

R squared = Sxy²/(Sxx × Syy). Both input lists must vary.

Symbols and units
a
X observations
b
Y observations

Use the units shown. A list keeps the order in which you enter its values. The symbol ^ means “raised to the power of”.

Calculation steps and notation

sum(list) adds all entries in the list.

Assumptions & limits

Assumptions & limits

  • Ordinary least squares with an intercept. No causal interpretation or prediction interval is provided. Lists support up to 1,000 finite values.
Are these inputs private?

These calculations run in your browser. A shared link contains the values you choose to share. Only questions submitted to the separate AI finder are sent to OpenAI.

Further reading

Method reference ↗

Background reading; this does not imply endorsement or independent review of SumFizz.

Share this page
Share this calculator

Leave unchecked to share the page without your entered values.