Relationship between residual term and sum of deviations of dependent variable

29 Views Asked by At

So I wanted to know how we get from the first to the second step in this equation. Note that the lower case y denotes deviations from the mean i.e. (Yi-Ybar). I know that summation(YbarUi(hat)) would be zero since Ybar goes out of the summation sign and summation of Ui is 0. But why would Summation(YiUi(hat)) be zero.

Screenshot of the equation

(Apologies I'm still learning how to write mathematical notation in the in-built code format that the text editor includes.)