# Alternate least squares estimate

• October 15th 2010, 04:11 PM
MichaelMath
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.
• October 15th 2010, 04:49 PM
MichaelMath
$= \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...
• October 15th 2010, 05:11 PM
MichaelMath
Okay i did it, nevermind. More of an algebra problem I guess. Oops