I'm really new to linear regression and am trying to teach myself.
In my textbook there's a problem that asks why $R^{2}$ in the regression of $Y$ on $X =$ the sample correlation between X and Y the whole squared.
I've been throwing my head against this for a while and I keep getting stuck because in the correlation coefficient there is a $X$ and $\bar{X}$ term, whilst in the $R^{2}$ term there is no such thing.
Can anyone provide a derivation as to why $R^{2}$ is the correlation coefficient squared?
Thanks!