00:02
We have five observations for two variables, x and y listed here.
00:06
And what we want to do is, there's two parts here.
00:10
The first thing we want to do is estimate the standard deviation of y hat star given x is 7.
00:17
And then the next thing we want to do is find the 95 % prediction interval, pi, for y given x is 7.
00:29
All right, so let's go ahead and do this.
00:31
I mean, actually, i've worked going to be, i used my spreadsheet to do a lot of calculations.
00:40
So the first thing we have to do, and i have some stuff hidden here that will show itself as we go along to do this.
00:46
So the first thing we need to do, let's get the formula for the prediction interval first.
00:50
Let's just, i mean, since that's where we're ahead of, let's get that first.
00:53
So it's going to be y hat, which is our prediction.
00:55
This is our least squares regression line prediction when y, when x is 7.
01:01
We do that plus minus t alpha over two with the n minus two degrees of freedom multiplied by this chunk here.
01:10
This is the answer to number one.
01:11
What we're about to have here is the answer for number one.
01:14
It's the mean squared error multiplied by one plus one over n, where n is the number of observations.
01:23
Plus then it's going to be x star minus x bar squared.
01:29
X star is the x is seven divided by the sum of all the x i is minus x bar squared so this is the sum of all the x's the sum of the squares of the x's all right so the answer for number one is right here this is number one this is that this is the answer so what we do for this let's see the mean square error so this mean square error is equal to the sum of all the y i values minus the y hat values, with that respective values squared all over n.
02:18
So we need the y hat values.
02:20
So to do the y hat values, to get the y hat values, we need the least squares regression line, which is given as y hat equals a plus b, x, where a is your intercept term, b is your slope.
02:36
And b is equal to the correlation coefficient multiplied by this standard deviation of y, divided by the standard deviation of x.
02:45
And then a is equal to y bar, the mean of the y's minus b times x bar, which is the mean of the x's.
02:57
So let's go ahead and do this.
03:00
So i need, i let my spreadsheet do the work for us.
03:04
So the mean in standard deviation, or in correlation coefficient are listed here.
03:08
I use the spreadsheet functions average.
03:13
So for the mean, i used average.
03:19
And then you put in your data.
03:21
And for the standard deviation, std -e -v dot s.
03:25
Make sure you do the dot s for the sample standard deviation, put in your data.
03:29
And then the correlation coefficient, correl.
03:35
You put in the x values and the y values, and then you get the correlation coefficient.
03:41
Those are the formulas.
03:41
And this is using google sheets, but excel has the same basic formulas.
03:46
So there's that.
03:47
So we have everything we need to compute a, b and a, which will give us our equation.
03:52
So if you've done that here.
03:54
So here's the sample standardvation of y here.
03:59
That's the s of y.
04:01
Here's the s of x.
04:03
Is that.
04:04
And then here's x bar and y bar here.
04:07
Of course the correlation coefficient.
04:10
And now here are the, here are the, the line.
04:15
The slope is negative 3, intercept of 69.
04:18
And i put the equation, the graph here, because any time i'm doing these with bivariate data, it's nice to seed the data.
04:26
So here it is.
04:29
All right, so then to get the y hat values, what we do is we substitute each x into this equation.
04:38
So i did that here.
04:41
This is the y hat values.
04:42
So the 60 comes from three times negative 3 plus 69, 12 times negative 3 plus 69 is 33 and so on so forth.
04:50
All right.
04:51
So that's the y hat values...