Formula and method
Slope = Σ(x − x̄)(y − ȳ)/Σ(x − x̄)². Intercept = ȳ − slope × x̄. The prediction is intercept + slope × x.
Worked example
For x values 1, 2, 3 and y values 3, 5, 7, the fitted line is y = 1 + 2x with R² = 1.
Fit a least-squares line to paired observations and calculate slope, intercept, R² and a prediction at a selected x value.
Printed from Calxy · https://www.calxy.net/math/linear-regression-calculator
-1000000000 – 1000000000
Predicted y on the fitted line
9.5000
Ordinary least squares with an intercept. A fitted association is not causation. Predictions outside observed x values are extrapolations; this tool does not calculate prediction intervals.
Slope = Σ(x − mean x)(y − mean y) ÷ Σ(x − mean x)².
Intercept = mean y − slope × mean x.
Predicted y = intercept + slope × selected x.
Slope = Σ(x − x̄)(y − ȳ)/Σ(x − x̄)². Intercept = ȳ − slope × x̄. The prediction is intercept + slope × x.
For x values 1, 2, 3 and y values 3, 5, 7, the fitted line is y = 1 + 2x with R² = 1.
No. It describes fit within the observed sample. It does not establish causation or make extrapolation reliable, and this tool does not provide prediction intervals.
Last updated . Results are estimates for informational purposes only.