OhMyCalc

Regression Calculator

Compute simple linear regression (y = mx + b) from three data points. Find the slope and intercept of the best-fit line.

How to Use the Regression Calculator

  1. Enter three (x, y) data pairs.
  2. Click Calculate to find the regression line.
  3. The equation y = mx + b is shown with slope and intercept.

Quick Reference

FromTo
(1,2),(2,4),(3,6)y = 2x + 0
(0,1),(1,3),(2,5)y = 2x + 1
(1,5),(2,3),(3,1)y = −2x + 7
m > 0Positive trend
m < 0Negative trend

Use Cases

Formula

m = Σ(xᵢ − x̄)(yᵢ − ȳ) / Σ(xᵢ − x̄)². b = ȳ − m·x̄. Least-squares fit.

Frequently Asked Questions

What is linear regression?
A statistical method that finds the best-fit straight line through data points, minimizing the sum of squared residuals.
What do slope and intercept mean?
The slope (m) is the rate of change of y per unit x. The intercept (b) is y when x = 0.
How many points are needed?
At least 2 for a line, but 3+ gives a true regression with residual information.