2
$\begingroup$

I have always taken $\text{“}R^2\text{”}$ to mean the proportion of a sum of squares explained by a model.

  • The context in which this idea is first encountered is when one explains part of the total corrected sum of squares $\sum_i (y_i-\overline y)^2$ by fitting a straight line $\widehat y = \widehat \alpha + \widehat\beta x_i + \widehat\varepsilon_i$ by least squares. We get an explained sum of squares $\sum_i \left( \widehat y_i - \overline y \right)^2$ and an unexplained sum of squares $\sum_i \left( y_i - \widehat y_i \right)^2.$

But both more complicated and simpler models exist.

  • One can partition the sum $\sum_i y_i^2$ into an explained part $n\overline y^2$ and a residual, or unexplained, part $\sum_i (y_i-\overline y)^2.$

  • One can also partition $\sum_i y_i^2$ into an explained part $\sum_i \widehat y_i^2 = \sum_i \left(\widehat\beta x_i\right)^2$ and an unexplained part $\sum_i \left( y_i - \widehat y_i \right)^2 = \sum_i \left( y_i - \widehat\beta x_i\right)^2.$

In all of these cases, the explained sum of squares divided by the sum of the explained and unexplained sums of squares is nonnegative.

However, in comments under this question and some of its answers, "Henry" takes the position that $R^2$ must always be defined as $1 - \frac{\sum_i \left( y_i - \widehat y_i \right)^2}{\sum_i (y_i-\overline y)^2},$ and so in some cases $R^2$ can be negative.

Are the conventional usages such that one should expect to be understood if one asserts that not fitting an intercept can result in a negative value of $R^2,$ as can happen if Henry's definition is used?

$\endgroup$
1
  • $\begingroup$ I am not sure I said "must", but rather that $1 - \frac{\sum_i \left( y_i - \widehat y_i \right)^2}{\sum_i (y_i-\overline y)^2}$ is how some people calculate $R^2$ outside simple linear regression $\endgroup$
    – Henry
    Commented Sep 29, 2023 at 18:35

1 Answer 1

4
$\begingroup$

The meaning of $R^2$ is ambiguous in all but the simplest settings. I like a particular calculation that makes sense to me (comparison to a baseline model that always predicts the overall mean, same as Henry’s that allows for values below zero) and is equivalent in simple settings to other common definitions. However, multiple definitions are possible and reasonable. For instance, as much as I disagree with this decision, a popular software package uses a different definition that I would when it comes to an out-of-sample calculation, and there is an argument to call this $R^2$.

Outside of simple settings, I would carefully define the exact calculation of $R^2$ that I am using.

$\endgroup$
2
  • $\begingroup$ For me the bigger problem with defining $R^2$ seems to be that it is sometimes used out of sample, and there some relationships break down. In sample we at least have a few clear definitions of $R^2$ to choose from. I am not sure whether the definitions of out-of-sample $R^2$ are as well established, and some of them are somwhat counterintuitive in light of the in-sample definitions. $\endgroup$ Commented Sep 30, 2023 at 6:11
  • $\begingroup$ @RichardHardy I give lots of thoughts on out-of-sample $R^2$ in the link in my answer. Yes, it’s complicated, but a recent article in The American Statistician (referenced in the linked question) seems to side with me in terms of what should be calculated, even if not everyone does it that way. I like your suggestion there that a name other than $R^2$ should be used, though I’m at a loss for a good name. “Dave’s statistic”? “Hardy’s statistic”? $\endgroup$
    – Dave
    Commented Sep 30, 2023 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.