# Why squaring $R$ gives explained variance?

This may be a basic question, but I was wondering why an $R$ value in a regression model can simply be squared to give a figure of explained variance?

I understand that $R$ coefficient can give the strength of a relationship, but I don't understand how simply squaring this value gives a measure of explained variance.

Any easy explanation of this?

Thanks very much for helping with this!

• Are you looking for something intuitive or more mathematical? Have you looked through some of the other questions on $R^2$ and correlation coefficients on this site? Commented May 9, 2012 at 23:46
• Two related questions are here and here, for example. If you play around with the equations there, you'll be able to derive the mathematical equivalence. But, neither are likely to be particularly helpful from an intuition standpoint. Commented May 9, 2012 at 23:47
• I see this the opposite way. It is R square that is defined as 1 -residual variance/total variance and then R is postive square root of that. It just happens that when we have simple linear regression R square reduces to the square of the correlation coefficient. Commented May 10, 2012 at 0:37
• @cardinal, I have the same impression - $R$ (or $r$) refers to the sample correlation coefficient and would be surprised to see a widely used reference that uses that to refer to the absolute value of the sample correlation Commented May 10, 2012 at 12:39
• I have once asked a question regarding the relationship between $R$ and $R^2$. Maybe it'll help shed some light on your question: stats.stackexchange.com/questions/65960/… Commented Dec 12, 2013 at 18:34

## 2 Answers

Hand-wavingly, the correlation $$R$$ can be thought of as a measure of the angle between two vectors, the dependent vector $$Y$$ and the independent vector $$X$$. If the angle between the vectors is $$\theta$$, the correlation $$R$$ is $$\cos(\theta)$$. The part of $$Y$$ that is explained by $$X$$ is of length $$\Vert Y\Vert\cos(\theta)$$ and is parallel to $$X$$ (or the projection of $$Y$$ on $$X$$). The part that is not explained is of length $$\Vert Y\Vert\sin(\theta)$$ and is orthogonal to $$X$$. In terms of variances, we have $$\sigma_Y^2 = \sigma_Y^2\cos^2(\theta) + \sigma_Y^2\sin^2(\theta)$$ where the first term on the right is the explained variance and the second the unexplained variance. The fraction that is explained is thus $$R^2$$, not $$R$$.

• (+1) Not too much handwaving going on here really. The geometric viewpoint is the most intuitive, in my view. There is likely to be a high-quality open-source figure out there that depicts things precisely this way. Commented May 10, 2012 at 10:25
• (+1) I started to write up a direct derivation that ${\rm cor}(y,\hat{y})^2$ was equal to the usual definition of $R^2$ as a ratio of variances but, in doing so, I noticed it provided little/no intuition (and so it probably wouldn't be helpful to the original poster) - I think this does! Commented May 10, 2012 at 12:17
• This doesn't answer the question but shows how R square is mentioned as the square of the correlation coefficient without any reference to R. So sources confirming or refuting my claim may be hard to find. This is from an article on the coefficient of determination in Wikipedia: Commented May 10, 2012 at 14:55
• As squared correlation coefficient Similarly, after least squares regression with a constant+linear model (i.e., simple linear regression), R2 equals the square of the correlation coefficient between the observed and modeled (predicted) data values. Commented May 10, 2012 at 14:56
• Under general conditions, an R2 value is sometimes calculated as the square of the correlation coefficient between the original and modeled data values. In this case, the value is not directly a measure of how good the modeled values are, but rather a measure of how good a predictor might be constructed from the modeled values (by creating a revised predictor of the form α + βƒi). According to Everitt (2002, p. 78), this usage is specifically the definition of the term "coefficient of determination": the square of the correlation between two (general) variables. Commented May 10, 2012 at 14:56

You can do this a long way and show that the total variance of the dependent variable is a sum of the variance of predicted and the error variance. The ratio of the variance or predicted to the variance of dependent variable is called $$R^2$$, and it's between 0 and 1 in OLS. It happens so that when you have only one independent variable $$\sqrt{R^2}=R$$, the Pearson correlation coefficient. That's why you can say that squaring the correlation coefficient gives the explained variance, i.e. the portion predicted variance to the total variance.