Deriving Regression Coefficients

rwinston
Messages
36
Reaction score
0
Hi

Sorry this may be an obvious one...can anyone help me with getting from the first to the second equation below? I'm particularly stuck with manipulating the terms inside the summations formulas.

I can derive to here:

<br /> \sum_{i=1}^{N}x_iy_i - N\bar{x}\bar{y} - \left( \sum_{i=1}^{N}x_i^2 - N\bar{x}^2\right)b_2 = 0<br />


But am a bit unsure of the exact manipulation to get to here:

<br /> b_2 = \frac{\sum_{i=1}^{N}(x_i-y_i)(y_i-\bar{y})}{\sum_{i=1}^{N}(x_i-\bar{x})^2}<br />

Thanks in advance!
 
Physics news on Phys.org
You already know the standard representation for the regression on the slope (its your second expresssion in the original post). So try to work backwards to show that this latter expression is identical to the expression you can derive. Reversing this will then generate the path from the expression you can derive to the standard representation.
 
Ah, yes...sorry, a bit obvious really when you think about it:

<br /> \sum_{i=1}^{N}x_i^2 -N\bar{x}^2<br />
<br /> = \sum_{i=1}^{N}x_i^2 -\sum_{i=1}^N\bar{x}^2<br />
<br /> \sum_{i=1}^{N}\left( x_i - \bar{x}\right)^2<br />

And the other bit:

<br /> \sum_{i=1}^{N}x_iy_i - N\bar{x}\bar{y} = \sum_{i=1}^{N}(x_i-\bar{x})(y_i-\bar{y})<br />

as

<br /> \sum_{i=1}^{N}(x_i-\bar{x})(y_i-\bar{y}) = \sum_{i=1}^{N}x_iy_i - N\bar{x}\bar{y}-N\bar{y}\bar{x}-N\bar{x}\bar{y}<br />
 
Back
Top