keisoku

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

211.91071416x = 1, y = 2x = 2, y = 4.1x = 3, y = 6.2x = 4, y = 7.8x = 5, y = 10.1x = 6, y = 11.9

Model comparison

ModelEquationR squared
Quadraticy = -0.01 + 2.061786 x + -0.0125 x^20.9987
Lineary = 0.106667 + 1.974286 x0.9986
Powery = 2.029386 x^0.9918270.9985
Logarithmicy = 1.083533 + 5.410768 ln(x)0.9410
Exponentialy = 1.840792 e^(0.338605 x)0.8998
Reciprocaly = 11.275578 + -10.429986 / x0.7819

Data points and fitted values

No.xyFitted
1122.039286
224.14.063571
336.26.062857
447.88.037143
5510.19.986429
6611.911.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

  1. Home
  2. Regression Model Comparison Calculator