This simple linear regression isn't adding up..

#1
Edit/Cliffnotes: CORRECTION- The second SSR formula in question is SSR = SUM((yhat(i) - ybar)^2), not SSR = SUM((y(i) - ybar)^2). Dragan resolved my other problem, so this formula is the only thing I'm confused on. Since I was getting multiple things going wrong, I thought there might be something wrong with the way I constructed this scatterplot and regression model, but now I suspect that the only problem is that I'm misinterpreting the way the formula is supposed to be used (or that it's bogus?). As you can see down below, for each data point I took point with the same X value that the regression line crossed through, squared the difference and so on, adding each value.

Hi all, I just found this forum, so I home my post is not considered inappropriate. I just have a beginner level regression question and I've searched and recalculated, but am still not sure what's going on here. If you see somewhere I'm misunderstanding things or making a mistake, I'd appreciate your input.

It helps me to conceptualize things if I play around with them and see how they work, so I drew up a little plot and a regression line. It works out to:

y^ = 3 + .75x

I plotted 9 points (btw I'm putting x before y in the parentheses, I can't remember if that's standard), three of which --- (4,6) (8,9) and (12,12) --- the line passes through:

(4,4) (4,6) (4,7)
(8,8) (8,9) (8,11)
(12,10) (12,12) (12,14)


The respective residuals should be -2, 0, +1, -1, 0, +2, -2, 0, +2 with sum and mean equal to 0 (-2+0+1-1+0+2-2+0+2=0, 0/9=0).

ybar = (4+6+7+8+9+11+10+12+14)/9 = 81/9 = 9
SSY = SUM((y-ybar)^2) = (5^2) + (3^2) + (2^2) + (1^2) + (0^2) + (2^2) + (1^2) + (3^2) + (5^2) = 78
SSE = SUM((y-yhat)^2) = (-2^2) + (0^2) + (1^2) + (-1^2) + (0^2) + (2^2) + (-2^2) + (0^2) + (2^2) = 18
r^2 = (SSY - SSE)/SSY = (78-18)/78 = .769

Here's where I run into trouble. I'm under the impression that two formulas for SSR (sum of squares regression) were

(1) SSY - SSE
(2) SUM((yhat(i)-ybar)^2)
--- (this one makes little sense to me, which spurred me to create this exercise in the first place to try to understand it).

However they aren't producing the same result in this case:

(1) 78 - 18 = 60
(2) 3((6-9)^2) + 3((9-9)^2) + 3((12-9)^2) = 54

I was also under the impression that SSE can be computed by the formula:

(1-r^2)SSR = SSE

However, neither of my computed SSRs make this equation work:

(1-.769)*60 = 0.231*60 = 13.86
(1-.769)*54 = 0.231*54 = 12.47
SSE = 18
 
Last edited: