Lack-of-fit sum of squares
The pure-error sum of squares is the sum of squared deviations of each value of the dependent variable
from the average value over all observations sharing its independent variable
value(s). These are errors that could never be avoided by any predictive equation that assigned a predicted value for the dependent variable as a function of the value(s) of the independent variable(s). The remainder of the residual sum of squares is attributed to lack of fit of the model since it would be mathematically possible to eliminate these errors entirely.
Sketch of the idea
by the method of least squares
. One takes as estimates of α
the values that minimize the sum of squares of residuals, i.e., the sum of squares of the differences between the observed y
-value and the fitted y
-value. To have a lack-of-fit sum of squares that differs from the residual sum of squares, one must observe more than one y
-value for each of one or more of the x
-values. One then partitions the "sum of squares due to error", i.e., the sum of squares of residuals, into two components:
sum of squares due to error = (sum of squares due to "pure" error) + (sum of squares due to lack of fit).
The sum of squares due to "pure" error is the sum of squares of the differences between each observed y-value and the average of all y-values corresponding to the same x-value.
The sum of squares due to lack of fit is the weighted
sum of squares of differences between each average of y
-values corresponding to the same x
-value and the corresponding fitted y
-value, the weight in each case being simply the number of observed y
-values for that x
Because it is a property of least squares regression that the vector whose components are "pure errors" and the vector of lack-of-fit components are orthogonal to each other, the following equality holds:
Hence the residual sum of squares has been completely decomposed into two components.
Consider fitting a line with one predictor variable. Define i as an index of each of the n distinct x values, j as an index of the response variable observations for a given x value, and ni as the number of y values associated with the i th x value. The value of each response variable observation can be represented by
be the least squares
estimates of the unobservable parameters α
based on the observed values of x i
and Y i j
be the fitted values of the response variable. Then
are the residuals
, which are observable estimates of the unobservable values of the error term ε ij
. Because of the nature of the method of least squares, the whole vector of residuals, with
scalar components, necessarily satisfies the two constraints
It is thus constrained to lie in an (N
− 2)-dimensional subspace of R N
, i.e. there are N
− 2 "degrees of freedom
be the average of all Y-values associated with the i th x-value.
We partition the sum of squares due to error into two components:
It can be shown to follow that if the straight-line model is correct, then the sum of squares due to error divided by the error variance,
Moreover, given the total number of observations N, the number of levels of the independent variable n, and the number of parameters in the model p:
- The sum of squares due to pure error, divided by the error variance σ2, has a chi-squared distribution with N − n degrees of freedom;
- The sum of squares due to lack of fit, divided by the error variance σ2, has a chi-squared distribution with n − p degrees of freedom (here p = 2 as there are two parameters in the straight-line model);
- The two sums of squares are probabilistically independent.
The test statistic
It then follows that the statistic
has an F-distribution
with the corresponding number of degrees of freedom in the numerator and the denominator, provided that the model is correct. If the model is wrong, then the probability distribution of the denominator is still as stated above, and the numerator and denominator are still independent. But the numerator then has a noncentral chi-squared distribution
, and consequently the quotient as a whole has a non-central F-distribution
- ^ Brook, Richard J.; Arnold, Gregory C. (1985). Applied Regression Analysis and Experimental Design. CRC Press. pp. 48–49. ISBN 0824772520.
- ^ Neter, John; Kutner, Michael H.; Nachstheim, Christopher J.; Wasserman, William (1996). Applied Linear Statistical Models (Fourth ed.). Chicago: Irwin. pp. 121–122. ISBN 0256117365.
Last edited on 1 April 2021, at 03:18
Content is available under CC BY-SA 3.0
unless otherwise noted.