# Why are there two different formulas for $R^2$?

Whereby one method is to square the $$r$$ (hence $$r^2$$) or the correlation coefficient, and the other method is 1 - (Sum of Squared Errors (from the regression line) / Sum of Squared Errors (from the mean y), i.e. $$R^2=1-\frac{\text{SSE}}{\text{SST}}$$

In simple linear regression, we have $$\hat{y_i}=\hat{\beta}x_i+\hat{\alpha}$$, where $$\hat{\beta}={{\sum (x_i-\bar{x})(y_i-\bar{y})}\over {\sum(x_i-\bar{x})^2}},\ \ \ \hat{\alpha}=\bar{y}-\hat{\beta}\bar{x}\rightarrow \hat{y}_i-\bar{y}=\hat{\beta}(x_i-\bar{x})$$ Substituting this into the formula of coefficient of determination: \begin{align}R^2&=\frac{SSR}{SST}=\frac{\sum (\hat{y_i}-\bar{y})^2}{\sum (y_i-\bar{y})^2}=\hat{\beta}^2\frac{\sum (x_i-\bar{x})^2}{\sum (y_i-\bar{y})^2}\\&=\left({{\sum (x_i-\bar{x})(y_i-\bar{y})}\over {\sum(x_i-\bar{x})^2}}\right)^2\frac{\sum (x_i-\bar{x})^2}{\sum (y_i-\bar{y})^2}\\&=\left(\underbrace{{{\sum (x_i-\bar{x})(y_i-\bar{y})}\over {\sqrt{\sum(x_i-\bar{x})^2\sum (y_i-\bar{y})^2}}}}_{R=\text{correlation coef.}}\right)^2\end{align}