A further implication of the assumptions made in defining the linear regression model is that the residuals are independent of the fitted values . This can be proved as follows:
Recall the model assumption that
Then the fitted values and estimated residuals are defined as
(11.1) |
and
(11.2) |
where we define
Since both and are both functions of the random variable , they are themselves random variables. This means that they have sampling distributions. We focus on the joint behaviour of the two random variables.
To show that the fitted values and estimated residuals are independent, we show that the vectors and are orthogonal, i.e. that they have a product of zero.
By definition of and ,
since . So .
This result uses the identities and . Starting from the definition of can you prove these identities? Now you should be able to show, by combining these identities, that is idempotent, i.e. that .
Since is idempotent, when applied to its image, the image remains unchanged. In other words, maps to itself. Can you show this? Mathematically, can also be thought of as a projection. The matrix is often referred to as the hat matrix, since it transforms the observations to the fitted values .
A sensible diagnostic to check the model fit is to plot the residuals against the fitted values and check that these appear to be independent:
For the fitted brain weight regression model described in example (11.1.1), a plot of the residuals against the fitted values is shown in Figure 11.3. The code used in R to produce this plot is
The horizontal line indicates the line of best fit through the scatter plot. The correlation between the fitted values and residuals is
In this case, there is clearly no linear relationship between the residuals and fitted values and so, by this criterion, the model is a good fit.