00:03
All right, hey guys, welcome to another econometrics tutorial, and in this one, we're going to be making a supply function and using some instrumental variables to help predict the quantity a bit more accurately.
00:22
So, sorry, the slope of the supply curve a bit more accurately.
00:24
So, of course, you're going to want to start by opening up the package, woodridge, and then the dataset cement, and then you're going to want to want to create.
00:35
Create your supply curve.
00:37
So, okay, first a little bit about the data for cement.
00:41
So the package here has a lot of, or the data set has a lot of data on cement, as you might imagine, by the name.
00:51
The important ones we're going to be using are the growth in the price of cement, which is gprc, the growth in the quantity of cement, which is gcem, and then gpr, c -p -e -t is the growth in the price of crude petroleum.
01:14
And then here we have a bunch of dummy variables for each month because the growth rates are calculated on a monthly basis, so it's good to have that along the side.
01:26
So let's go ahead and run the linear model, and let's see what rb2 is, which would be the coefficient for our...
01:38
Growth in cement quantity, which for the supply curve is the slope.
01:45
So over here, our b2 is, so your basic economic knowledge might be screaming out at you, because typically when you think of supply curves, they're upward sloping.
01:58
But here, our b2, so our slope of our supply curve is actually negative.
02:03
It's negative 0 .04.
02:05
4.
02:06
So that is indeed quite weird.
02:10
So to see if we can maybe find out if there's anything else affecting the quantity here, we're going to use some instrumental variables.
02:21
So first, of course, you have to open up the aer package to be able to use the instrumental variable function in r.
02:29
So do that.
02:30
And then we'll make our instrumental variable equation here.
02:35
So if you might remember from some of past videos you write your equation as normal and then you put a vertical line there and then you write the reduced form so what that would mean is basically write the equation the same again but remove what you want to be using instruments for and then add the instruments on the end so in this case we're going to be using g -defs which is the growth in monthly government spending on defense and then we'll we'll get the summary of that and the diagnostics to have a look at the instrumental variable tests.
03:17
All right.
03:17
So since we just have one, we don't have to worry about the sargon test.
03:22
Well, right off the bat, the weak instruments test.
03:25
We're not rejecting the null hypothesis.
03:27
So government defense is a weak instrument for the growth rate in cement quantity, which kind of makes sense...