00:01
All right, hello everybody.
00:02
This is a pretty long problem.
00:04
We're going to be comparing two different data sets that measure essentially the same thing with some slight differences.
00:10
And we're going to be basically discussing the importance of having comparable populations.
00:16
So again, there's a pretty long one.
00:17
So let's buckle in and get straight into it.
00:19
First thing we're going to need is we're going to need our woldridge package.
00:27
This contained their data sets.
00:30
I'm always, i'm always.
00:30
Also going to be using the dplyr package.
00:37
This package allows me to basically take account of all the data points and observations in a dataset.
00:45
It just makes my life a little bit easier.
00:48
So yeah, all right, we're gonna be using the woldridge library and the dplyr library.
00:56
Okay, all right, so first thing we will, and of course, sorry, our two datasets are the j train 2 and the j train 3 datasets.
01:06
Okay, let's get into it.
01:08
So first we want to find the fraction of members of the first data set that actually received job training.
01:14
So the way we're going to do this is we're going to say count and then we're going to find the subset of j train 2 where the condition for our subset subset is train equals 1.
01:26
So basically, whoever in this subset did receive job training, then we're going to divide that simply by the number of members of j -train 2.
01:35
And we will get about 41 .6%.
01:39
Right? we can do this exact same thing for j -train 3, and i'm only actually just going back in same function, same line of code, just changing the variable.
01:49
And we will see that here only 6 .92 % of the members received job training.
01:58
And so this difference is really important because in the first one, it's an experiment, right? we've done an experiment to find the results of job training on real earnings.
02:09
And the second one is just observational and there are a lot more members and very few of them actually went through job training.
02:17
So that's an important difference.
02:19
In fact, if we look at this, we can see that in j train two, there are only 445 people using the experiment.
02:25
But if we take this observational look, there are 2 ,675 people that responded to the observational survey.
02:35
So that's a pretty important difference.
02:37
Okay.
02:38
Now we're going to run a regression.
02:41
Actually, let me keep going.
02:46
There we go.
02:47
Okay.
02:47
Now we're going to run a regression on j train 2 to calculate the effect of training on real earnings in 78.
02:56
So pretty simple.
02:58
We're going to do j train 2 regression is a linear model, right, of re78 on training.
03:08
And our data is j train 2.
03:10
Again, this is a very standard, basically linear model function.
03:15
And if we take our summary, we will find that the effect of training is that, first of all, it is significant at the 5 % confidence level, or significance level.
03:24
But we will find that in the experimental study, if you receive training, your real earnings would go up by $1 ,794 .3.
03:37
Okay? so that's our estimated effect of participating in job training.
03:41
Now we're going to add some controls.
03:45
So our j -train controlled is going to be the same formula, but we're also going to add in re70.
03:56
Plus re75 plus education plus age plus black plus hispanic and when we take the summary of this we'll see that the training estimate actually didn't change that much is still significant at the 5 % confidence level but yeah this didn't change too much right it's still pretty close here it was 1 .7943 and here it's 1 .6801 so this isn't changing too much simply because it's an experiment and it's already designed to control for these factors, right? all of these are designed to be controlled for in an experiment that's trying to study this specific relationship.
04:40
Otherwise, it wouldn't be a good experiment if, you know, all these other factors influenced it.
04:45
So, yeah, so that's an important difference between something experimental versus something non -experimental.
04:51
And we will actually check that out right now by trying this exact same thing with the j train 3 dataset.
04:59
So here, same function, but instead this is a j train 3 regression.
05:05
Keep in mind, this one was observational, not experimental.
05:11
And same thing here with our controlled.
05:14
So we have our j train 3 regression and our j train 3 controlled.
05:18
And if we take the summary of these two, and the summary of our controlled, we will see that, so in our regular regression, there's actually a negative impact from training onto real earnings if you don't control for other factors.
05:39
When we do control for other factors, we do find a positive impact, but it's very minimal.
05:45
And that's because only 6 .915%, if you recall, actually receive job training in the previous one, which means that, you know, if people choose to receive job training, it doesn't really have a big impact on real earnings.
06:05
Okay.
06:06
All right.
06:07
So, and so if we look at the t statistics, we'll also find that training isn't statistically significant at all.
06:15
It's very, it's not even close.
06:18
This is a 0 .803 compared to the 0 .05, you need to be significant at the 5 % significance level.
06:24
So, and the effect of controlling for other factors now shows that, yeah, these other factors really do determine the real earnings in 78 as opposed to training.
06:35
It doesn't actually have a huge effect.
06:39
Okay, cool.
06:41
So that's a good comparison to make.
06:44
Now we're going to add into both of these a new variable.
06:49
This is called average real earnings.
06:52
And we're going to call this, we're going to define this as the earnings, as the average of the earnings in 74 and 75.
07:04
Sorry, i forgot it to 2 here.
07:06
But our formula is just going to be the real earning 74 plus the real earning 75 divide by 2.
07:12
And we'll do the same thing for j -train 3.
07:21
Awesome.
07:22
Now we have our two things.
07:23
In fact, just to show you, if i view this, go all the way.
07:28
Oh, hold up.
07:33
Here, to the end, you'll see we have our averages here.
07:38
And again, most of these are zero because they didn't really have real earnings in that time.
07:43
But again, here.
07:45
Here you can see, you know, the average coming through.
07:51
So now we want to find our sample averages, standard, and min -max for this variable...