Linear Regression, what's the difference between $x$ and $x - \bar{x}$?

29 Views Asked by At

In Linear Regression, what's the difference between $\displaystyle\hat{\beta} = \frac{\sum_{i = 1}^{n}\left(x_i - \bar{x}\right)\left(y_i - \bar{y}\right) } {\sum_{i = 1}^{n}\left(x_i - \bar{x}\right)^2}$ and $\displaystyle\hat{\beta} = \frac{\sum_{i = 1}^{n}x_i\left(y_i - \bar{y}\right) } {\sum_{i = 1}^{n}x_i^2}$

I see both formulas come up in different places, but I don't really understand why it is presented sometimes as what I presume as centering $x_i$ in the first fraction compared to not doing so in the second?