# Sum of squares regression proof [closed]

Could anyone show me how to prove the following:

$$SS_{reg} = \sum_{i = 1}^{n}(\hat{y}_{i} - \bar{y})^{2} = \dfrac{\sum_{i = 1}^{n}[(x_{i} - \bar{x}) (y_{i} - \bar{y})]^{2}}{\sum_{i = 1}^{n}(x_{i} - \bar{x})^{2}}$$

I am unsure about what context to provide but the proof my textbook has is a little confusing, so I was hoping someone else had a better way of doing this.

To provide a little more context, the question is about simple linear regression model with OLS estimators

## closed as off-topic by spaceisdarkgreen, Przemysław Scherwentke, Thomas Andrews, Namaste, Claude LeiboviciFeb 13 '18 at 10:44

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – spaceisdarkgreen, Namaste, Claude Leibovici
If this question can be reworded to fit the rules in the help center, please edit the question.

• Links to questions or equations are frowned upon. See Nash J's edit for how to typeset equations using mathjax. Also your question may soon be closed for lack of context because it doesn't give any indication of where you're stuck. – spaceisdarkgreen Feb 12 '18 at 17:52
• Hey thank you for the clarification, I will update the question with Nash's edit and add some context! – Macterror Feb 12 '18 at 17:56
• A good question then would be to reproduce the calculation in the textbook (or part of it) along with a description of which pieces you don't understand. Otherwise we don't know what we're trying to be less confusing than. – spaceisdarkgreen Feb 12 '18 at 18:33
• Yeah I apologize for that, I wanted to try and paste a picture of the entire thing but I can only have a link to it and I am fairly unfamiliar with the latex like language mse supports – Macterror Feb 12 '18 at 18:39

Assuming $y_i = \beta_0 + \beta_1 x_i + \epsilon_i$, $i = 1,...,n$. The OLS estimator of $\beta_1$ and $\beta_0$ are $$\hat{\beta}_1 = \frac{\sum (x_i - \bar{x}_n)(y_i - \bar{y}_n)}{\sum (x_i - \bar{x}_n)^2}, \quad \hat{\beta}_0 = \bar{y}_n - \hat{\beta}_1 \bar{x}_n,$$ thus replace in $SSreg$ the $\hat{y}_i$ with $\bar{y}_n - \hat{\beta}_1 \bar{x}_n + \hat{\beta}_1x_i$ and show that $$SSreg = \hat{\beta}_1^2\sum(x_i - \bar{x}_n)^2,$$ now replace $\hat{\beta}_1$ with its explicit form and cancel out the $\sum(x_i - \bar{x}_n)^2$ to get the answer.