00:01
All right, so we have sales of a company in the past five years, the year is 2016 up to 2020.
00:07
And these are the sales in millions of euros.
00:10
And we're going to use a least squares regression line to estimate the sales in the year 2027.
00:15
So let's go ahead and get our equation pulled together.
00:18
So y hat equals a plus bx.
00:22
You might see the intercept term as beta not and then the slope term is beta 1.
00:31
Either way, the same thing.
00:33
Just a different notation.
00:34
I'll just stick with a, b, though.
00:38
And then we calculate those in the following way.
00:42
So b is calculated as the standard deviation in y divided by the standard deviation in x multiplied by the correlation coefficient.
00:51
And then a is calculated as y bar minus b times x bar.
00:58
So the means in sample standard invasions are pretty straightforward.
01:02
Correlation coefficient, we have to calculate that.
01:06
And i'm going to use a spreadsheet to do all this work for us, which is just because it makes our work a little nicer.
01:12
Before you go into the calculations here, somebody to note, these years are independent variable, our x values.
01:17
These are very cumbersome to use.
01:19
So what i did is i changed 2016 to be year one.
01:24
And then 2020 to be year five.
01:30
So that just makes things a little easier.
01:32
So these are our x values that we're going to use.
01:35
So when we put in five, we actually mean 2020.
01:37
We put in 1, we mean 2016.
01:39
We put in 3, 2018, and so on and so forth.
01:42
All right.
01:43
So let's go ahead and get calculating here.
01:47
So the means, i use this function called average.
01:53
And the spreadsheet, average, put in your cell references.
01:57
And for the sample of standard invasions, st -d -v .s, put in the data.
02:03
And then for correlation coefficient r, i use this function called corel.
02:09
In your spreadsheet.
02:10
And what you do is you put in your x data.
02:12
Well, it doesn't matter, extra y data, and then your x data.
02:17
And let me show what that looks like.
02:25
And we'll do a and b and put it all together.
02:28
All right, so there we go.
02:30
So this is what i mean with the, so there's the mean of the x's.
02:33
There's the mean of the sales in millions for those five years right here.
02:38
This is the mean years in terms of years.
02:40
So you don't, it's just there for us.
02:45
Sample standardvation of the x's variables and y variables and we're using these although it's funny if you were to find the sample standard deviation of these five consecutive years they're the same so it's kind of an interesting fun thing to play with correlation coefficient this is what i mean about how you put it in the cell reference so you put in your your i use the x i do the x's first you could doesn't matter you could do x first and y doesn't really matter because the correlation is the same regardless of which you're independent and dependent variable are the correlation stays the same.
03:18
Your equation would be different, however, the correlation would be the same.
03:22
So you're going to get this value.
03:27
0 .99886861.
03:29
And when we substitute all these values in for b and into these formulas here for b and a, we get these values.
03:37
So our function then becomes y hat is the intercept term 3 .2 plus 8 .4.
03:46
X.
03:47
There we go.
03:49
And now let's go ahead and use this to find these estimate the sales in years in the year 2027.
03:56
So we're not going to put 2027 here because we didn't use the actual year.
04:01
We use these little these separate variables.
04:03
0 1 through or 1 through 5.
04:06
But we only get to 2027.
04:08
So let's think about this.
04:10
Well, the difference in each of these is 15.
04:13
All right.
04:15
2016 minus 1.
04:16
It's 15 years.
04:17
Well, i don't mean 15, but it's a difference of 15, just to consider years.
04:22
There's still the 2 ,000, but just looking at the last two digits.
04:26
16 minus 1 is 15.
04:27
17 minus 1 is 15...