# Proof that correlation coefficient squared equals the coefficient of determination

Hi I as the title says I'm looking at the proof that $r^2$ = $R^2$ in the case of simple linear regression, but I don't understand one part. There are different versions of the proof, but in most of them they do a step I don't understand. You may look at slide 9 here for instance. Particularly I don't understand how $(Y-\hat{Y})(\hat{Y}-\bar{Y}) = 0$. Could anyone please explain to me why that is?

Thank you

• I'm thinking maybe it has something to do with covariance, but I'm not sure how, any intuitions? – Girauder Nov 19 '15 at 16:45