Regression Calculator
Fit a least-squares line to your (x, y) data. Get slope, intercept, R squared, Pearson r, standard error, residuals, and a predicted y value.
Regression Prediction Examples
| Paired Points | Best-Fit Line | Input x | Predicted y |
|---|---|---|---|
| (1, 3), (2, 5), (3, 7) | y = 2x + 1 | 4 | 9 |
| (0, 10), (2, 9), (4, 8) | y = -0.5x + 10 | 6 | 7 |
| (1, 3), (2, 6), (3, 9) | y = 3x | 2.5 | 7.5 |
| (0, 4), (4, 5), (8, 6) | y = 0.25x + 4 | 8 | 6 |
| (1, 5), (2, 5), (3, 5) | y = 5 | 12 | 5 |
Frequently Asked Questions about the Regression Calculator
What does this regression calculator do?
It fits a straight line y = mx + b through your data points using ordinary least squares. You get the slope, intercept, equation, R squared, Pearson correlation r, standard error of the estimate, and the residual for each point. Add an x value and it also predicts the matching y.
How many data points do I need?
At least 2 points with at least 2 different x values. With only 2 points you get a perfect fit by construction, so R squared equals 1 and the standard error is reported as 0. Standard error is most useful from about 5 or 6 points upward.
What does R squared mean?
R squared is the share of the variance in y that the line explains, between 0 and 1. An R squared of 0.85 means the line explains 85 percent of the variation in your y values. The rest is scatter the line cannot capture.
Why did the calculator return no result?
Two reasons. Either you entered fewer than 2 valid points, or every x value is the same. A vertical line has an undefined slope under least squares, so the calculator returns no equation rather than a misleading one.
Can I use this for curved data?
No. This tool is strictly linear regression. If your data follows a curve, transform it first (for example, take the log of y for exponential growth or use x squared for a parabola) and then fit a line to the transformed values.
Related Calculators
More calculators in "Math"
Arc Length CalculatorLong Division CalculatorAsymptote CalculatorLimit CalculatorPPM CalculatorSynthetic Division Calculator
See all 202 calculators in "Math"