keisoku

Weighted Regression Analysis (Model Comparison)

Fit six models (linear, logarithmic, exponential, power, reciprocal, quadratic) to frequency-weighted data, compare them by weighted R squared, and show the best model and its equation.

Input

Enter (x, y, frequency) on each line. The frequency is a weight for how many times the point was observed. A line without a frequency is treated as frequency 1.

One point per line, separated by a comma or space. At least 3 points are required.

Result

Best model: Logarithmic

y = 2.164 + 2.126 ln(x)

Logarithmic

1

Quadratic

0.996

Power

0.979

Linear

0.944

Reciprocal

0.923

Exponential

0.849

Best model R squared

1

Total frequency

19

Number of points

6


Scatter plot and best model curve

1.1920.752.4982.1253.8053.55.1124.8756.4196.25x=1, y=2.2, frequency=3x=2, y=3.6, frequency=5x=3, y=4.5, frequency=4x=4, y=5.1, frequency=2x=5, y=5.6, frequency=4x=6, y=6, frequency=1

The size of each point shows its frequency.

Model comparison table

ModelEquationWeighted R squared
Logarithmicy = 2.164 + 2.126 ln(x)1
Quadraticy = 0.784 + 1.628 x − 0.131 x²0.996
Powery = 2.334 · x^0.5630.979
Lineary = 1.916 + 0.759 x0.944
Reciprocaly = 6.121 − 4.229 / x0.923
Exponentialy = 2.24 · exp(0.193 x)0.849

Data and best model fitted values

No.xyFrequencyFitted
112.232.164
223.653.637
334.544.499
445.125.11
555.645.584
66615.972

How it works

  • Each data point is entered as (x, y, frequency). A line without a frequency is treated as frequency 1. The frequency is a weight that represents how many times the point was observed.
  • Linear, logarithmic, exponential, power, reciprocal, and quadratic models are fitted by weighted least squares. Nonlinear models are linearized with logarithms before estimating coefficients.
  • Each model coefficient of determination R squared is computed in the original y scale with weights, and the model with the highest R squared is presented as the best model.
  • Logarithmic and power models need positive x, exponential and power models need positive y, and the reciprocal model needs nonzero x. Models that fail these conditions are excluded from the comparison.
  • In the scatter plot the size of each point reflects its frequency, and the blue curve is the regression curve of the best model.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. Weighted Regression Analysis (Model Comparison)