# Math Help - Alternate least squares estimate

1. ## Alternate least squares estimate

I am trying to show that:

$\frac{\sum_i x_i y_i - n \bar{x} \bar{y}}{\sum_i x_{i}^2 -n \bar{x}^2}=\frac{\sum_i (x_i - \bar{x})(y_i - \bar{y})}{\sum_i (x_i - \bar{x}^2)}$

This is how far I got:

$\frac{\sum_i x_i y_i - n \bar{x} \bar{y}}{\sum_i x_{i}^2 -n \bar{x}^2}$

$= \frac{ \sum_i x_i y_i - n \sum_i \frac{x_i}{n} \sum_i \frac{y_i}{n} }{\sum_i x_{i}^2 -n \sum_i \frac{x_i}{n} \sum_i \frac{x_i}{n}}$

$= \frac{ \sum_i x_i y_i - \frac{1}{n} \sum x_i \sum y_i }{\sum_i s_{i}^2 - \frac{1}{n} \left( \sum_i x_i \right)^2}$ ...

Am I doing this right? Not sure what to do next.

2. $= \frac{\sum_i x_i y_i - \sum_i x_i \bar{y}}{\sum_i x_{i}^2 - \sum_i x_i \bar{x}}$

$= \frac{\sum_i x_i (y_i - \bar{y})}{\sum_i x_i (x_i - \bar{x})}$ ...

stuck again...

3. Okay i did it, nevermind. More of an algebra problem I guess. Oops