00:01
So we're given the simple linear regression model, yi is equal to beta naught plus beta 1 xi plus the error, where this is a mean of zero, and i goes from 1n, however many our samples are.
00:23
And then we have the sum of squares error is defined as the sum of yi minus y hat hat i squared and y i y hat i this is given by beta hat not the estimated intercept plus beta one hat which is the estimated slope times xi and what we're going to do is we're going to to derive the following identity.
01:02
Some squares of error is equal to syy minus beta hat 1 sxy.
01:15
And we are going to use the following forms.
01:22
This syy is like the total deviation from the means.
01:26
So what that means is you take your yi, the actual value, minus the means squared.
01:32
And then we also so we have sxy is defined as the sum of each x minus the mean multiplied by each y minus the mean of the y's.
01:47
So we're going to prove this using these two things here.
01:52
And of course this definition here.
01:54
So let's go ahead and go through this.
01:59
But we're also going to recall there's one more thing we need to know.
02:01
Is that beta hat 1 is equal to sxy over sxx.
02:11
And s, it's not really, well, i guess we'll define that too.
02:18
Sxx is the sum of each x value minus the mean of the xs.
02:25
Like that, the squared deviation from the means.
02:29
And then we also have beta naught, which is equal to y bar minus beta hat 1 times x bar.
02:41
So let's go ahead and go through this.
02:45
So let's use our model.
02:48
Let's go back here, this thing.
02:49
And what we're going to do is we're going to substitute what we know about beta hat 0 and beta hat 1.
02:55
So that means we have this y hat i is equal to beta 0, right? right? beta hat naught, which is y bar minus beta hat 1 x bar.
03:08
So that's the beta naught plus beta hat 1 times xi, like that.
03:20
Okay, we can do a little arithmetic here.
03:23
So y bar, let's move some things around.
03:26
So we get plus beta hat 1 times xi minus x bar.
03:31
We just do a little switch the order here and just factor out the beta hat one so there's that, now let's, and this is why hat i, now what we're going to do is we're going to find the residual, so this is the definition of the predicted value, the residual which is this part here, the sum of squares of the error, this is the residual this is the squared residuals, so we're going to do y i the actual value minus so what we're doing is we're just taking the actual value minus the predicted value so this is the residual so let's simplify this a little bit y i minus y bar minus beta i times x i minus x bar great and this is y i minus y hat i so now we're going to square these let's go and do that square it and then we get yi minus y hat i and this is squared and then let's go ahead and do a little squaring of this stuff here so we still have yi minus y bar and then we're gonna have so it's like this and break this this into a piece and then we have it's like this times this so and then we have two of them so minus two beta hat i times x minus x bar times y minus y bar and then we have this whole thing squared so it's positive beta hat i beta bit hat one, whoops, bit hat one.
05:53
Bit hat one times xi minus x bar squared.
06:06
So as you're going through this, please just make sure you have all your, you're not forgetting a term that you have all the things squared, all your terms squared.
06:14
Make sure you have the constants, which are the means, and your iterated variables, x and y, marked as so.
06:22
Great, so all we did is we expanded this right side, by squaring it and now you'll notice we're getting it looking like this there's that sy y y minus y bar and then s x y x minus x bar times y minus y bar and then of course that s x x x minus x bar sort of seeing that here now we're going to take the sum of all this stuff so we have the sum of y i minus y hat i squared and this and all these are these uh summations are going to iterate over i from i is 1 to m equals the sum of y oops that should be squared y i minus y bar squared minus now we're going to put 2 beta hat 1 because these are constants so we don't they're they're not going to be summed over.
07:20
Because you can just factor them out.
07:21
And then we have the sum of xi minus x bar times yi minus y bar plus beta hat 1 squared times the sum of xi minus x bar squared.
07:47
Okay, good.
07:48
So now let's see what we got.
07:49
So this is the sums of squares of the error, s, s, e.
07:52
That's the definition we have.
07:56
Right here, y minus y hat squared equals y minus y bar squared.
08:03
Y minus y bar is the syy.
08:08
Syy minus 2 beta hat 1.
08:12
This sum of x bar y minus y bar that's x s x y plus beta 1 hat squared times and this is sxx which is right here x minus x bar squared and remember just remember we're trying to get trying to get this let me copy this actually bring it down so we can kind of see what we're going for okay so s y y we have that that's good.
09:02
Now remember beta hat 1 is sxy over sxx.
09:09
So sxy over sxx and then we still have this sxy right here.
09:18
Sxy plus now beta hat 1 remember is sxy over sxx and we're going to square that times sxx.
09:32
Now these, this square is going to go to the numerator and the denominator, but then this sxx we cancel out with one of those.
09:41
So we're just left with this.
09:45
Sxy squared over sxx...