# Value of $\sum_{j=1} (y_{j} - \bar{y})$ and proving properties of hat value

The i-th fitted value $$\hat{Z}_i$$ is written as a linear amalgam of response values $$\hat{Z}_i=\sum_{j=1}h_{ij}Z_j$$ where $$h_{ij}=\frac{1}{n}+\frac{(y_i-\bar{y})(y_j-\bar{y})}{S_{yy}}$$ and $$S_{yy}=\sum_{i=1}(y_i-\bar{y})^2$$.

I am trying to show $$\sum_{j=1}h_{ij}^2=h_{ii}$$ and $$\sum_{j=1}h_{ij}y_j=y_i$$; however, I am already stuck on the first one after doing the following.

\begin{align} h_{ij}^2 &= \Bigg[\frac{1}{n}+\frac{(y_i-\bar{y})(y_j-\bar{y})}{S_{yy}}\Bigg]^2 \\ &= \frac{1}{n^2}+\frac{2}{n}\frac{(y_i-\bar{y})(y_j-\bar{y})}{S_{yy}}+\frac{(y_i-\bar{y})^2(y_j-\bar{y})^2}{S_{yy}^2} \\ &= \frac{S_{yy}^2}{n^2S_{yy}^2}+ \frac{2n}{n^2}\frac{S_{yy}(y_i-\bar{y})(y_j-\bar{y})}{S_{yy}^2} +\frac{n^2(y_i-\bar{y})^2(y_j-\bar{y})^2}{n^2S_{yy}^2} \\ &=\frac{S_{yy}^2+2nS_{yy}(y_i-\bar{y})(y_j-\bar{y})+n^2(y_i-\bar{y})^2(y_j-\bar{y})^2}{n^2S_{yy}^2} \\ &=\frac{\big[S_{yy}+n(y_i-\bar{y})(y_j-\bar{y})\big]^2}{n^2S_{yy}^2} \end{align} I don't see how applying the summation $$\sum_{j=1}$$ to this leads to $$h_{ii}=\frac{1}{n}+\frac{(y_i-\bar{y})^2}{S_{yy}}$$. Am I missing something about what can be assumed or what is already known about $$\sum_{j=1}(y_j-\bar{y})$$ and $$\sum_{j=1}(y_j-\bar{y})^2$$?

Focus on your second line. First term: $$\sum_j\frac{1}{n^2}=\frac{n}{n^2}=\frac{1}{n}$$ Second term: $$\sum_j\frac{2}{n}\frac{(y_i-\bar{y})(y_j-\bar{y})}{S_{yy}^2}=\frac{2(y_i-\bar{y})}{nS_{yy}^2}\sum_j(y_j-\bar{y})=0$$ Third term: $$\sum_j\frac{(y_i-\bar{y})^2(y_j-\bar{y})^2}{S_{yy}^2}=\frac{(y_i-\bar{y})^2}{S_{yy}^2}\underbrace{\sum_j (y_j-\bar{y})^2}_{S_{yy}}=\frac{(y_i-\bar{y})^2}{S_{yy}}$$ When summed, the three terms give you $$h_{ii}$$.
• Thank you. If you don't mind I'm having a similar issue with proving $\sum_{j=1}h_{ij}y_j=y_i$. I have simplified the equation all the way to $\sum_{j=1}h_{ij}y_j=\bar{y}+\frac{(y_i-\bar{y})}{S_{yy}}\Bigg[\sum_{j=1}(y_j^2-\bar{y}^2)\Bigg]$, but cannot proceed further. It looks like I need $\sum_{j=1}(y_j^2-\bar{y}^2)=S_{yy}$, but I don't think I can make this happen. I tried introducing $2y_j\bar{x}-2y_j\bar{y}$ within the summation, but that gives me a $2\bar{y}^2n$ term I cannot seem to get rid of. – strwars Oct 13 '19 at 1:06