00:02
We're giving some data here on the traffic flow and vehicles per hour on six highways and these are the speeds and this is during rush hour.
00:13
So we want to find the least squares regression line for this and test the significance of the correlation.
00:21
So the form that i'm going to use for the least squares regression line is a plus bx, a is the intercept term, b is the slope terms, and b is calculators are correlation and coefficient times the steering deviation in y divided by the steering deviation in x and then a is equal to y bar minus b times x bar so we need those functions let's go ahead and get those so use a spreadsheet to get them this is what we get so then i use these average and standard deviation functions to get the mean and station of the x and y values and this correlation function equals corral x y to get a corel coefficient .9201.
01:15
And i rounded the equation after i substituted in the standard evisions and means for x and y.
01:25
I rounded those to two decimals.
01:27
So our equation is y hat.
01:30
Let me do it here so i have more space is equal to a which is a thousand ten times or 1 ,010 .08 plus 7 .14x.
01:48
All right.
01:49
And so then we want to find s, which is the standard, we're going to call this the standard error of the model, which is given as the square root of the sum of the y values minus the y -hat values, quantity squared, divided by n minus 2.
02:11
For the regression.
02:12
That's why it's in minus two down here.
02:15
And so we can get the y hat values by substituting the x values here into our function.
02:26
Getting the y hat values, let's do that.
02:30
That's what we have here.
02:33
And y minus y hat are given right here.
02:37
So there's a few things going on here.
02:38
So this is the, uh, each of these terms of the numerator add them up get this ss is the sum of squares so 3577 that's the numerator divided by in this case four i think the square of that number is this this is the standard error 29 .906 we can round it to point 91 if you go to two decimals all right then we're going to find the r squared value which is this square, this number squared.
03:16
It's the correlation coefficient squared.
03:17
It is that value.
03:18
It's kind of fun.
03:20
0 .84, let's say this 0 .847, we'll say.
03:29
And then i'm going to find the adjusted r squared.
03:33
Now this is given as 1 minus the sum squares of the residual.
03:40
I'll show you what those are in second, divided by n minus k all over the sum of the total divided by big n minus one.
03:50
All right, so what's big n? big n is the number of samples.
03:53
So this case, big n is 6.
03:57
K is the number of terms here.
04:07
It's going to have an intercept and a coefficient.
04:11
So k is 2.
04:13
So that means it's going to be four.
04:16
Six minus two is four.
04:19
So the sum of squares of the residual.
04:21
So what is that? and we have it.
04:23
It's right here, actually.
04:24
That's it.
04:25
Summa squares of the residual is exactly that.
04:28
Because you're taking, it's the residual values after you take the actual value minus the predicted.
04:35
And so that is, and you're squaring those distances.
04:37
That's the sum of the squares of the residual right there.
04:41
So let's put it all in a full...