How to show that these two alternative formulas for slope are equivalent

139 Views Asked by At

First Formula $$b_1=\dfrac{\displaystyle\sum_{i=1}^n(Y_iX_i-\bar Y \bar X)}{\displaystyle\sum_{i=1}^n(X_i^2-\bar X^2)}$$

Second Formula $$b_1=\dfrac{\displaystyle\sum_{i=1}^nY_i(X_i- \bar X)}{\displaystyle\sum_{i=1}^n(X_i-\bar X)^2}$$

I understand the derivation of the slope $b_1$ in the Ordinary Least Squares regression. However, I am having a hard time converting the initial formula to the second one using algebra.

2

There are 2 best solutions below

0
On BEST ANSWER

Both the numerator and the denominator can be adjusted using the two tricks that $\sum_{i=1}^n C = nC$ where $C$ is a constant, and $n\bar{Y} = \sum_{i=1}^n Y_i$.

In the numerator, you just have to expand:

$\sum \bar{X} \bar{Y} = \bar{X} \left(\sum \bar{Y}\right) = \bar{X} \left(n \bar{Y}\right) = \bar{X} \sum Y_i$ and you can then combine that with the other term and factorise the common $\bar{X}$

In the denominator, you need to expand the square, and then use the tricks to make two of the terms partially cancel out.

0
On

$$\sum_{i=1}^n(X_i-\bar X)^2=\sum_{i=1}^n(X_i^2-2X_i\bar X+(\bar X)^2)=\sum_{i=1}^nX_i^2-2\bar X\sum_{i=1}^nX_i+\bar X^2\sum_{i=1}^n1$$ Now $\sum_{i=1}^nX_i=n\bar X=\bar X\sum_{i=1}^n1$. I will replace this in the middle term. I get $$\sum_{i=1}^nX_i^2-2\bar X\bar X\sum_{i=1}^n1+\bar X^2\sum_{i=1}^n1=\sum_{i=1}^nX_i^2-\bar X^2\sum_{i=1}^n1=\sum_{i=1}^n(X_i^2-\bar X^2)$$ You can proceed similarly for the numerator