Example 1
perfect proportional fit: (1,2),(2,4),(3,6)
Given
- points
- 1.x 1y 2
- 2.x 2y 4
- 3.x 3y 6
Assumptions
- Simple least squares: errors in y only, equal weight per point, straight-line model.
Solution steps
Fit the line with centered sums
The slope is the ratio of the x–y co-variation to the x variation; the line passes through (x̄, ȳ).
b = Sxy/Sxx; a = ȳ − b·x̄
x̄ = 2; ȳ = 4; Sxx = 2; Sxy = 4; slope b = 2; intercept a = 0
= 2
Goodness of fit
r² is the fraction of the y variation explained by the line; the standard error of the estimate is the typical residual size.
r² = 1 − SSres/Syy; SEE = √(SSres/(n − 2))
SSres = 0; r = 1; r² = 1; SEE = 0
= 1
Results
Slope b
2
Intercept a
0
Correlation coefficient r
1
Coefficient of determination r²
1
Standard error of the estimate
0
Where this answer was checked
- source
- Exact rational least squares — y = 2x exactly
- verified by
- hand-recomputed
- derivation
- x̄=2, ȳ=4. Sxy = (−1)(−2)+0+(1)(2) = 4; Sxx = 2. slope = 2, intercept = 0, r = 1, SEE = 0.