Formulas (ordinary least squares)
- m = Σ((xᵢ − x̄)(yᵢ − ȳ)) / Σ((xᵢ − x̄)²)
- b = ȳ − m·x̄
- R² = 1 − (Σ(yᵢ − ŷᵢ)² / Σ(yᵢ − ȳ)²)
Paste two columns of paired data (x, y). The calculator fits the line y = m·x + b by ordinary least squares and reports slope, intercept, R² and residual sum.