<p>Working backwards from the numerator in 11 to the numerator in 10, we have:</p>
<p><span class="math-container">$$\begin{align}\tag{11}\sum_{i=1}^n(X_i-\bar{X})(Y_i-\bar{Y})
&amp;=\sum_{i=1}^n (X_iY_i-X_i\bar{Y}-\bar{X}Y_i+\bar{X}\bar{Y})\\
&amp;=\sum_{i=1}^n X_iY_i- \sum_{i=1}^nX_i\bar{Y}- \sum_{i=1}^n\bar{X}Y_i+\sum_{i=1}^n\bar{X}\bar{Y}\\
&amp;=\sum_{i=1}^n X_iY_i- \bar{Y}\sum_{i=1}^nX_i-\bar{X} \sum_{i=1}^nY_i+n\bar{X}\bar{Y}\\
&amp;=\sum_{i=1}^n X_iY_i- \bar{Y}(n\bar{X})-\bar{X} (n\bar{Y})+n\bar{X}\bar{Y}\\
&amp;=\sum_{i=1}^n X_iY_i- n\bar{X}\bar{Y}-n\bar{X}\bar{Y}+n\bar{X}\bar{Y}\tag{B}\\
&amp;=\sum_{i=1}^n X_iY_i- n\bar{X}\bar{Y}\tag{A}\\
&amp;=\sum_{i=1}^n X_iY_i- n \left(\frac{1}{n}\sum_{i=1}^nX_i\right)\left(\frac{1}{n}\sum_{i=1}^nY_i\right)\\
&amp;=\sum_{i=1}^n X_iY_i- \frac{1}{n}\left(\sum_{i=1}^nX_i\right)\left(\sum_{i=1}^nY_i\right) \tag{10}\\
\end{align}$$</span></p>
<p>The term <span class="math-container">$\bar{X}\sum_{i=1}^nY_i=n\bar{X}\bar{Y}$</span> is added and subtracted when going from <span class="math-container">$(\text{A})$</span> to <span class="math-container">$(\text{B})$</span>.</p>

CC BY-SA 4.0
2023-07-20T17:47:50.880Z
Thank you! It took me a while to get, even whith your step-by-step solution. Now onto the denominator! :D
AoMRos
CC BY-SA 4.0
2023-07-10T14:52:53.630Z
2023-07-10T14:52:53.630Z
smcc
<p>I'm studying for an Econometrics exam and going over an old lecture slide (see picture).
In it the lecturer is deriving <code>\beta_1</code> in a basic OLS regression with one variable.</p>
<p>I understand everything up to equation 10 and I am able to calcualte eq.11, but I do not understand <em>why</em> the additions/subtractions need to be made in eq. 11. From what I can tell <code>\beta_1</code> in 10 is not equal to <code>\beta_1</code> in 11?</p>
<p>Can someone explain why the calcutations are made in this way? And is equation 10 equal to 11?
This is very important for me to know because deriving <code>\beta_1</code> has been a question in basically every exam.</p>
<p><a href="https://i.sstatic.net/r9vUf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/r9vUf.png" alt="enter image description here" /></a></p>
<p><strong>EDIT:</strong> I realize now that this question should probably be posted on the statistics-SE instead. I am not eligible to migrate questions so I would appreciate the help of a moderator for doing this. :)</p>

<econometrics><regression>
Deriving `\beta_1` in OLS
AoMRos
# Deriving `\beta_1` in OLS

(Asked by: username_0 on 2023-07-10)

I'm studying for an Econometrics exam and going over an old lecture slide (see picture).
In it the lecturer is deriving `\beta_1` in a basic OLS regression with one variable.

I understand everything up to equation 10 and I am able to calcualte eq.11, but I do not understand *why* the additions/subtractions need to be made in eq. 11. From what I can tell `\beta_1` in 10 is not equal to `\beta_1` in 11?

Can someone explain why the calcutations are made in this way? And is equation 10 equal to 11?
This is very important for me to know because deriving `\beta_1` has been a question in basically every exam.

[![enter image description here](https://i.sstatic.net/r9vUf.png)](https://i.sstatic.net/r9vUf.png)

**EDIT:** I realize now that this question should probably be posted on the statistics-SE instead. I am not eligible to migrate questions so I would appreciate the help of a moderator for doing this. :)

**Tags:** econometrics, regression

---

## 1 answers

### Answer by username_1 on 2023-07-10. Score: 3 | Accepted answer

Working backwards from the numerator in 11 to the numerator in 10, we have:

$$\begin{align}\tag{11}\sum\_{i=1}^n(X\_i-\bar{X})(Y\_i-\bar{Y})
&=\sum\_{i=1}^n (X\_iY\_i-X\_i\bar{Y}-\bar{X}Y\_i+\bar{X}\bar{Y})\\
&=\sum\_{i=1}^n X\_iY\_i- \sum\_{i=1}^nX\_i\bar{Y}- \sum\_{i=1}^n\bar{X}Y\_i+\sum\_{i=1}^n\bar{X}\bar{Y}\\
&=\sum\_{i=1}^n X\_iY\_i- \bar{Y}\sum\_{i=1}^nX\_i-\bar{X} \sum\_{i=1}^nY\_i+n\bar{X}\bar{Y}\\
&=\sum\_{i=1}^n X\_iY\_i- \bar{Y}(n\bar{X})-\bar{X} (n\bar{Y})+n\bar{X}\bar{Y}\\
&=\sum\_{i=1}^n X\_iY\_i- n\bar{X}\bar{Y}-n\bar{X}\bar{Y}+n\bar{X}\bar{Y}\tag{B}\\
&=\sum\_{i=1}^n X\_iY\_i- n\bar{X}\bar{Y}\tag{A}\\
&=\sum\_{i=1}^n X\_iY\_i- n \left(\frac{1}{n}\sum\_{i=1}^nX\_i\right)\left(\frac{1}{n}\sum\_{i=1}^nY\_i\right)\\
&=\sum\_{i=1}^n X\_iY\_i- \frac{1}{n}\left(\sum\_{i=1}^nX\_i\right)\left(\sum\_{i=1}^nY\_i\right) \tag{10}\\
\end{align}$$

The term $\bar{X}\sum\_{i=1}^nY\_i=n\bar{X}\bar{Y}$ is added and subtracted when going from $(\text{A})$ to $(\text{B})$.

> **Comments:**
> **username_0**: Thank you! It took me a while to get, even whith your step-by-step solution. Now onto the denominator! :D  

---

