00:01
So we're given this table of data, and we are going to be using linear regression with it.
00:08
Because the sample size is so small, we can do this one by hand.
00:13
But hopefully your teacher is letting you do these in excel, since you can make programs that will just do all the work for you when you input the data set.
00:23
But this one we can do by hand, just in case there's some people that need it to be done that way.
00:31
So the first thing we're going to do is make a scatter plot with years as the x and income as the y.
00:41
Our years seem to be going from 10 to 18.
00:45
So i'm just going to do this in increments of 2.
00:49
So 14, 16, 18.
00:53
And our weekly income goes from about 400 to 1 ,200.
00:58
So i'm just going to go up by 400.
01:02
800, 800, and 1200.
01:08
And now let's start plotting points.
01:12
So first one is 10, 450.
01:16
So around here, 12, 600, 16, 1 ,100, and 18, 1 ,180.
01:31
So is there a linear relationship? it's pretty clear that there is.
01:35
You can almost perfectly draw a line right through this and my graph isn't perfect obviously so it might perfectly fit a line but this one you can clearly see the line so this one is yes now for part c and d we're going to come back to this later because almost all of the work for this one is done in a future step so let's just skip there and then we'll come back here at the end so find the line of best fit so we're going to need to get some information before we are able to do this because we need to find our slope which is m and the y intercept which is b so we're going to need some other information first first off is the sum of x and the sum of y so to do this we just take every x value and add them up and that's the sum of x same thing for sum of y so the sum of x is 56 and the sum of y is 3 ,473.
02:45
The next one we need is the sum of xy, the sum of x squared.
02:55
So for sum of x, y, you're going to take each x value and multiply it by its respective y value.
03:03
So 10 times 453, plus 12 times 618 and so on.
03:10
And for sum of x squared we take 10 squared plus 12 squared plus 16 squared plus 18 squared so sum of xy is 52 ,952 and the sum of x squared is 824 you notice 824 is not 56 squared you can't just take 56 and square it there is a difference and we are also going to need our sample size, which is n.
03:45
This is just how many points we have, and we have four, so n is equal to four.
03:52
So let's get to work.
03:55
So the first thing we're going to need to do is find the sum of squares of x.
03:58
So this is equal to the sum of x squared, which is 824 minus the sum of x squared.
04:06
So 56 squared and n is equal to 4.
04:14
And from this you get 40.
04:17
So then we need the sum of squares of xy.
04:20
And this is equal to the sum of xy, which is the 52 ,000 minus the sum of x times the sum of y.
04:30
So 56 times 3, 473.
04:34
And this is divided by the sample size 4.
04:37
And this is 4330.
04:43
So now we can get our slope.
04:46
So m is equal to the sum of squares of xy, which we just found, that is 4 -3 -3 -0, divided by the sum of squares of x, which is 40.
04:58
And this gives us 108 .25.
05:04
And then b, our y -intercept, that is equal to the sum of y, so free.
05:10
473 minus so our slope 108 .25 times the sum of x which is 56 divide the whole thing by four.
05:22
This is the only one where we divide the whole thing.
05:26
Notice the two other ones.
05:27
It's only the last part.
05:29
That is something to be careful of if you have to memorize these equations...