Linear Regression Calculator

Fit a simple linear regression line and return slope, intercept, and R².

Scratchpad (not saved)

What This Calculator Does

Fit a simple linear regression line and return slope, intercept, and R².

It combines x1, y1, x2, y2 to estimate Regression Equation, Slope, Intercept.

Formula & Method

Core equations: m=nxyxynx2(x)2,b=yˉmxˉ,R2=1SSresSStotm=\frac{n\sum xy-\sum x\sum y}{n\sum x^2-(\sum x)^2},\quad b=\bar{y}-m\bar{x},\quad R^2=1-\frac{SS_{res}}{SS_{tot}}.

Notation used in the formulas: RR = Regression Equation; x1x_{1} = x1; x2x_{2} = y1; x3x_{3} = x2; x4x_{4} = y2; x5x_{5} = x3; x6x_{6} = y3.

Method summary: inputs are normalized to consistent units, core equations are evaluated, then secondary values are derived and rounded for display.

Use this calculator for quick scenario analysis. Start with baseline values, change one driver at a time, and compare how sensitive the results are to each input shown above.

Reference Book

Introduction to Mathematical Statistics

Global Edition

Robert V. Hogg, Joseph McKean, and Allen T. Craig · Pearson

A standard reference for probability distributions, estimation, hypothesis testing, regression, and ANOVA.

View Book

Inputs Used

  • x1: Used directly in the calculation.
  • y1: Used directly in the calculation.
  • x2: Used directly in the calculation.
  • y2: Used directly in the calculation.
  • x3: Used directly in the calculation.
  • y3: Used directly in the calculation.
  • x4: Used directly in the calculation.
  • y4: Used directly in the calculation.
  • x5: Used directly in the calculation.
  • y5: Used directly in the calculation.

Related Calculators

Linear Regression Calculator: Formula & Use Cases | MCPCalc