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
The size of each point shows its frequency.
Model comparison table
| Model | Equation | Weighted R squared |
|---|---|---|
| Logarithmic | y = 2.164 + 2.126 ln(x) | 1 |
| Quadratic | y = 0.784 + 1.628 x − 0.131 x² | 0.996 |
| Power | y = 2.334 · x^0.563 | 0.979 |
| Linear | y = 1.916 + 0.759 x | 0.944 |
| Reciprocal | y = 6.121 − 4.229 / x | 0.923 |
| Exponential | y = 2.24 · exp(0.193 x) | 0.849 |
Data and best model fitted values
| No. | x | y | Frequency | Fitted |
|---|---|---|---|---|
| 1 | 1 | 2.2 | 3 | 2.164 |
| 2 | 2 | 3.6 | 5 | 3.637 |
| 3 | 3 | 4.5 | 4 | 4.499 |
| 4 | 4 | 5.1 | 2 | 5.11 |
| 5 | 5 | 5.6 | 4 | 5.584 |
| 6 | 6 | 6 | 1 | 5.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
- Home
Weighted Regression Analysis (Model Comparison)