00:01
All right, hello everybody.
00:02
Today we are going to be doing a fairly basic econometrics exercise, exploring the sensitivity of ols and lad estimates and how sensitive they are to outliers.
00:13
So let's get right into it.
00:14
First thing we want to do is install our woldridge package.
00:20
We don't already have it installed.
00:24
I should already have this installed, but the fact that i don't slightly worries me.
00:32
Okay, and there we go.
00:34
The package is now installed and i can open up the library.
00:38
I should, for this one, we're also going to be using the l1 pack package.
00:45
This package has the lad function, so it just makes it a little bit easier on us to actually perform the lad function.
00:57
So that's that and really click in a comment here.
01:02
I'm going to write out our formula.
01:04
Our formula for today is going to be r &rd in tens is equal to sales plus sales square.
01:12
Sales square is a column already in the dataset so we don't have to worry about manually squaring sales plus profmarch.
01:22
Okay, cool.
01:23
So now let's get straight into it.
01:27
So first we want to estimate the equation using ols.
01:31
But before we do that, actually, we need to change sales and sales square to be in billions of dollars.
01:37
Right now, they're in millions.
01:39
So this is pretty easy.
01:41
It would be if i had the dataset.
01:44
But let's look at this really quick, right? so we have our data set here.
01:49
You can see sales, 4 ,570.
01:53
This is millions.
01:54
All of these are millions.
01:56
And sales square is therefore millions squared.
01:59
So we have 2 .089 times 10 to the seventh, right? or the sixth, et cetera, et cetera, et cetera.
02:07
So what we're going to have to do is we are going to have to convert sales to billions and sales squares to billions.
02:17
So how do we do that? well, to change something, what we're going to want to do is we're going to say rd chem.
02:22
That's our table or data set.
02:25
And then we're going to select the sales column.
02:28
Then we're going to use our variable equality operator, right? so rdcm sales is going to be equal to sales divided by 1 ,000.
02:38
Pretty simple.
02:39
To do this for sales squared, we can't divide by 1 ,000.
02:43
In fact, we have to divide by 1 ,000 squared or 1 million.
02:52
So doing that, you'll now see we come up to here.
02:56
Our sales is now 4 .570, right? that's 1 ,000 times less.
03:01
And our sales, the coefficient here went from 10 to the 7th to 10 to the 1st.
03:06
That's a difference of 10 to the 6th or 1 million.
03:10
So you can see that this all worked out fine.
03:13
All right, now we need to perform our ols estimates...