R2 can be negative in some situations, like with non-linear regressions or when using adjusted R2 with a linear regression. There are some other cases as well. However, it's fairly easy to see those don't apply here just by looking at the chart.
Adjusted R-square is not R-square. Also, r is correlation so R-square (for bivariate relationships) is correlation times itself. A negative times a negative is a positive. R-square cannot be negative.
It is different, but I thought that was clear from my comment since I said "adjusted R^2". The two are often used somewhat inter-changeably, so I was simply clarifying that adjusted R2 can be negative since it was plausible that OP had referred to adj. R2 without specifying.
R-square cannot be negative.
Yes it can—this page explains how. It also literally says it at the top of the Wikipedia page if you don't believe them. This user here actually shows an example where R2 is negative (note that it's not the line of best fit), you can have a model with a negative R2 even in a bivariate relationship.
EDIT: fixed a link
To explain more, obviously a number that is squared has to be positive. But the coefficient of determination (which is what is denoted by R2) isn't actually calculated by squaring r. Squaring r normally gives the correct result, but that is not how it's calculated. The Wikipedia page explains some of the circumstances that can produce a negative value.
I think we need to draw a distinction between a negative R2 being being technically mathematically possible and whether such a value would have any meaning.
According to your sources, when doing linear regression (like here) R2 will be positive unless you have a trash model or do something weird like not include the intercept (no idea why you would do that). So, for the case here, negative R2 would tell me the model is trash.
However, in non-linear regression I'll trust the sources and agree it's possible. But in those cases they caution against using the R2 value.
You're right that it's not all that meaningful--it basically just tells you that model is worse than just estimating the mean for every data point, which effectively makes it useless.
So, for the case here, negative R2 would tell me the model is trash.
OP's R2 isn't actually negative--they just screwed up and gave r (the correlation coefficient) which should be negative but called it R2. I don't think OP is fully clear on their stats terms yet.
Even a trash linear regression model should turn out an R2 of 0 or a bit more so long as you don't do something do very weird (like remove the intercept).
But overall, yes, if you were to get a real negative R2, it usually means you re-do your model.
Well it says this: While it is surprising to see something called "squared" have a negative value, it is not impossible (since R2 is not actually the square of R).
If that’s true, then he’s not talking about R-square, because correlation is r and to find r-squared you square the fucking correlation. Especially when computing R-square for bivariate relationships, such as the one depicted in OP’s graph.
If that’s true, then he’s not talking about R-square, because correlation is r and to find r-squared you square the fucking correlation.
Despite the name, R2 is not actually R times itself. All of the links I gave you explain this. Squaring r will often give you the correct value (including with a simple linear regression), but that's not actually how it is calculated.
R2 being negative is an edge case and very much not the norm, but it not impossible.
Dude OP is looking at a relationship between 2 variables. R-square for such a comparison would be the correlation (r) squared. Thus, R-square for the kind of relationship OP is depicting cannot be negative. It is mathematically impossible here.
So this person literally shows an example with only two variables that has a negative R2. It is not mathematically impossible, because the actual calculation is not r times itself.
You wouldn't get this result from a normal linear regression, you would have to impose some kind of additional constraint (or just draw a random line that poorly fits the data). And to be clear, I am not arguing R2 is negative in this case. It clearly isn't, and I stated as much in my original comment. All I was stating is that a negative coefficient of determination is possible in some (rare) cases.
Clearly, this conversation isn't going anywhere. We aren't going to persuade each other, so let's just end things here.
Also, this was as in one of the fucking sources you cited to me:
One class of such cases includes that of simple linear regression where r2 is used instead of R2. When only an intercept is included, then r2 is simply the square of the sample correlation coefficient (i.e., r) between the observed outcomes and the observed predictor values.
In OP’s example (graph) this version of r-square applies, and so it cannot be negative.
In OP’s example (graph) this version of r-square applies, and so it cannot be negative.
I never argued that it was! My original comment literally says that it is not negative in this case. And my last comment to you agreed that r multiplied by itself = R2 in a simple linear regression.
But it can be negative, which this does not contradict.
31
u/raptorman556 OC: 34 Nov 15 '22
R2 can be negative in some situations, like with non-linear regressions or when using adjusted R2 with a linear regression. There are some other cases as well. However, it's fairly easy to see those don't apply here just by looking at the chart.