00:01
Alright, so we're looking at if getting more education will help people live longer.
00:06
And we have some fictional data here where there's some country that has 100 million people in it.
00:13
And here's some fictional data about their education levels, non -primary, secondary, college or higher, and their ages, 30s, 45s, and 70s.
00:21
And we're going to calculate the marginal probabilities.
00:23
Well, these aren't marginal probabilities, these are counts.
00:26
And in fact, these are in terms of millions.
00:27
So this is 1 million, 2 million, 6 million, etc.
00:30
So what we do is we take each of these values and divide them by 100 because there's 100 million people.
00:36
So that'll give us the probabilities, the joint probabilities.
00:40
So the probability of having no education and being in your 30s is 1, 1 million out of 100 million.
00:48
That's why we do divide by 100.
00:50
And we do that and we get the following.
00:52
And there we go.
00:56
So we've taken all of those values up here, the counts, divided by 100 to get the probabilities.
01:04
There we go, that's the joint probability.
01:05
The marginal probabilities are going to be the sum to cross the rows.
01:11
So what we do is we sum across the rows to get the p of x values, probability of x.
01:25
You can even say f of x values.
01:28
Same thing for the ys, you sum across the columns though.
01:30
And you'll see i wrote f of xy here.
01:33
You'll oftentimes see that in terms of a distribution.
01:36
I wrote p here.
01:37
You could easily write p if you want.
01:40
Or excuse me, you could easily write f instead of p.
01:43
And you could write f of y.
01:46
And here you could write f of x.
01:50
So there you go.
01:50
Those are the marginal probabilities.
01:52
So none would be this, primary is that, secondary is 0 .54, college or higher is 0 .09.
01:58
And then being in your 30s is 0 .29, 45 is 0 .27, 70 is 0 .34.
02:03
There we go.
02:04
Those are the marginal probabilities.
02:05
Now we want to see if they're independent.
02:07
Well, independence would, occurs when the joint f of xy, right, so like this, like having no education in your 30s or having secondary education and being 45 is 0 .21, would be equal to the sum of the marginals, f of x times f of y.
02:30
So that means 0 .37 times 0 .54 would give us this.
02:35
Because 0 .55 is all secondary, 0 .37 is all average 45s, all the age 45 people.
02:42
And then the product of them should give us the joint.
02:45
And do they? that's the question.
02:49
So what we're looking for, just to be clear about that, what we're looking for is 0 .21, question mark, is that equal to 0 .37 times 0 .54? and you look at all the values.
03:05
And sure enough, it is not.
03:08
The marginals don't change, but these joints would.
03:12
And we can see that they're not equal.
03:14
So this is, they're not independent.
03:17
There we go.
03:17
So not independent.
03:18
All right.
03:19
The next question is to calculate the mean and standard deviation of x.
03:22
So for that, i have the joint, or excuse me, i have the marginals for p of x listed out that are more clearly for us.
03:32
Here we go.
03:34
All right.
03:34
P of x.
03:36
So x is, oh, i didn't have this up here because they didn't want us to get confused by it.
03:41
We have a 0, 1, 2, and 3 for non -primary, secondary, and college or higher.
03:45
And those are factors because these are numbers, but we need to do work with them.
03:50
We have to think of these as factors.
03:51
So there we go...