Statistics

Linear Regression Calculator

Best fit line for paired data.

Enter your values

ⓘ Live results

Results
Equation
y = 1.99286x + 0.25714
Slope
1.992857
Intercept
0.257143
R squared
0.99827
Prediction
20.18571

Quick answer

Least squares regression finds the line minimising squared vertical distances, giving y = mx + b.

m = Σ(x−x̄)(y−ȳ)/Σ(x−x̄)², b = ȳ − mx̄

How to use the Linear Regression Calculator

  1. 1Paste your X values.
  2. 2Paste matching Y values.
  3. 3Enter an x value to predict.

Worked example

Using the values the calculator loads with:

Inputs

  • X values1, 2, 3, 4, 5, 6, 7
  • Y values2.1, 4.3, 6.2, 8.5, 10.1, 12.4, 14.0
  • Predict y at x =10

Results

  • Equationy = 1.99286x + 0.25714
  • Slope1.992857
  • Intercept0.257143
  • R squared0.99827
  • Prediction20.18571

Frequently asked questions

What is a good R squared?

Depends on field — 0.9+ in physics, 0.3 can be meaningful in social science.

Can I extrapolate?

Cautiously — predictions outside your data range are unreliable.

About this calculator

Results are estimates for general information. For medical, legal, structural or financial decisions, confirm with a qualified professional.