Statistics

Linear Regression Calculator

Fit a best-fit line through up to four points.

Parameters Live Compute
Calculated Output
Best-fit line y = 1.9x + 0
Slope 1.9
Intercept 0
R² 0.9627
Formula: least squares: slope = Σ(x−x̄)(y−ȳ) ÷ Σ(x−x̄)²
Step-by-Step Breakdown
1. Values used:
2. x₁ = 1
3. y₁ = 2
4. x₂ = 2
5. y₂ = 4
6. x₃ = 3
7. y₃ = 5
8. x₄ = 4
9. y₄ = 8
10.
11. Best-fit line = y = 1.9x + 0
12. Slope = 1.9
13. Intercept = 0
14. R² = 0.9627
Did this calculator solve your problem today?
Report issue to loopingon.com
Sponsored

Find the least-squares line of best fit through your data points.

The math behind it

slope = Σ(x−x̄)(y−ȳ) ÷ Σ(x−x̄)²; intercept = ȳ − slope×x̄; R² measures fit quality.

Worked Example

Sample points → y ≈ 1.9x + 0 (R² ≈ 0.92).

Frequently Asked Questions

R²?

The fraction of variance in y explained by x (0–1).

Advertisement