Regression Model Comparison Calculator
Fit six models (linear, logarithmic, exponential, power, reciprocal, quadratic) to your data and compare them by R squared to find the best regression equation, with a scatter plot and fitted curve.
Input
Enter (x, y) data points on multiple lines to fit six regression models, compare them by the coefficient of determination R squared, and get the best fitting equation.
One point per line. Separate x and y with a comma or space (for example 1, 2.5). At least three points.
Result
Best model: Quadratic
y = -0.01 + 2.061786 x + -0.0125 x^2
Coefficient of determination R squared = 0.9987
R squared by model
Quadratic
0.9987
Linear
0.9986
Power
0.9985
Logarithmic
0.9410
Exponential
0.8998
Reciprocal
0.7819
Scatter plot and fitted curve
Model comparison
| Model | Equation | R squared |
|---|---|---|
| Quadratic | y = -0.01 + 2.061786 x + -0.0125 x^2 | 0.9987 |
| Linear | y = 0.106667 + 1.974286 x | 0.9986 |
| Power | y = 2.029386 x^0.991827 | 0.9985 |
| Logarithmic | y = 1.083533 + 5.410768 ln(x) | 0.9410 |
| Exponential | y = 1.840792 e^(0.338605 x) | 0.8998 |
| Reciprocal | y = 11.275578 + -10.429986 / x | 0.7819 |
Data points and fitted values
| No. | x | y | Fitted |
|---|---|---|---|
| 1 | 1 | 2 | 2.039286 |
| 2 | 2 | 4.1 | 4.063571 |
| 3 | 3 | 6.2 | 6.062857 |
| 4 | 4 | 7.8 | 8.037143 |
| 5 | 5 | 10.1 | 9.986429 |
| 6 | 6 | 11.9 | 11.910714 |
How it works
- Enter each point on its own line as x then y, separated by a comma or space (for example 1, 2.5). Blank lines are ignored. At least three points are required.
- Six models are fitted: linear y = a + b x, logarithmic y = a + b ln(x), exponential y = a e^(b x), power y = a x^b, reciprocal y = a + b / x, and quadratic y = a + b x + c x^2.
- Linear, logarithmic, reciprocal, and quadratic models use ordinary least squares directly. Exponential and power models are linearized with logarithms to estimate the coefficients.
- Logarithmic and power models require positive x values, and exponential and power models require positive y values. Models whose conditions are not met are excluded from the comparison.
- The coefficient of determination R squared is evaluated from residuals on the original (x, y) scale, so models with different transforms can be compared fairly. R squared closer to 1 means a better fit.
- The model with the highest R squared is presented as the best fit. Be cautious when extrapolating even with a high R squared, and check that the chosen model matches the context and theory of your data.
Reviews
Tell us what you think of this calculator.
Write a review
- Home
Regression Model Comparison Calculator