For the simple linear regression model, show that the elements of the hat matrix $H$ are...

1.9k Views Asked by At

Need some help with this one. For the simple linear regression model, show that the elements of the hat matrix $H$ are:
$h_{ij}=1/n + (x_i -\bar x)(x_j -\bar x)/S_{xx}$ and
$h_{ii}=1/n + (x_i -\bar x)^2/S_{xx}$
Please help me MathStack (Vancak), you are my only hope.

1

There are 1 best solutions below

0
On BEST ANSWER

In general, recall that $$ H= X(X'X)^{-1}X'= \begin{pmatrix} 1\quad x_1 \\ 1\quad x_2\\ :\quad : \\ 1\quad x_n \end{pmatrix} \begin{pmatrix} \quad\frac{\sum x_i^2}{nS_{xx}} \quad-\frac{\sum x_i}{nS_{xx}} \\ -\frac{n}{nS_{xx}} \quad \frac{n}{nS_{xx}} \end{pmatrix} \begin{pmatrix} 1 \quad 1\quad 1 \quad ...\quad 1 \\ x_1 \quad x_2 \quad x_3 \quad \, ...\quad x_n\end{pmatrix}. $$ So, basically just multiple and manipulate slightly the sums. For $h_{ii}$ you can see here, the transition to $h_{ij}$ should be straightforward.