2

In a simple linear regression

$SSR = \sum(\hat{y} - \bar{y})^2$

$SSXY = \sum(x - \bar{x})(y-\bar{y})$

$SSX = \sum(x - \bar{x})^2$

$SSR$ can be computed by dividing $SSXY^2$ by $SSX$. Namely, $SSR = SSXY^2/SSX$

Could someone illustrate mathematically how this is obtained? Thanks!!

Alex
  • 437
  • 1
  • 5
  • 15

1 Answers1

2

From the answers at Is there a way to use the covariance matrix to find coefficients for multiple regression? we know the least squares equations for the estimated coefficient $\widehat\beta$ are

$$SS_X \widehat\beta = SS_{XY}$$

where the predicted values are given by

$$\widehat{y}_i=x_i\widehat{\beta}.$$

Squaring both sides and summing, recognizing that $\Sigma_i x_i^2=SS_X$, yields

$$SS_R=SS_X \widehat\beta^2.$$

Plugging in the solution $\widehat\beta^2 = \left(SS_{XY} / SS_X\right)^2$ from the first equation turns this into

$$SS_R=SS_X \left(SS_{XY} / SS_X\right)^2 =SS_{XY}^2/SS_X.$$

whuber
  • 281,159
  • 54
  • 637
  • 1,101
  • I can follow the logic of your explanation, but after the step $\widehat{y}_i=x_i\widehat{\beta}.$, I can't seem to get things right. For example, when I square $\widehat{y}_i$, what I get is the sum of the square of each predicted value, not $\sum(\hat{y}-\bar{y})$. Could you explain a little as to what might be my mistake? (I was doing it in `R`, so I basically did `y_hat %*% y_hat`) – Alex Jul 30 '14 at 00:19
  • 1
    Without any loss of generality, you may assume that the means of the $x$ and $y$ are zero (center the variables). – whuber Jul 30 '14 at 01:45