Linear Regression Calculator
Fit a least-squares line to paired measurements and evaluate it at an entered x.
Your result
MATHEnter your values and select calculate.
On this page How it works & practical examples
How to use the Linear Regression Calculator
Enter paired observations on separate lines. Ordinary least squares treats x as the predictor and minimizes squared vertical residuals. The output includes the line coefficients and R² as a descriptive fit measure.
The calculation
Worked example
Points (1,3), (2,5) and (3,7) fit y = 2x + 1 exactly. The line predicts y = 9 at x = 4.
Assumptions and limits
X values cannot all be identical. The tool does not establish causality, estimate prediction intervals or validate extrapolation. Constant y gives an undefined R² under this stated convention.
Common questions
Does a high R² prove one variable causes another?
No. It describes fit to these observations, not a causal relationship.
Can I reverse x and y?
That solves a different least-squares problem and need not produce the reciprocal line.