- [Instructor] Hi everyone.
This week we're going to be learning with
or learning about instrumental variables
and two-staged least squares.
This is a way that we can deal with endogenous regressors.
Last time, we had an endogeneity problem
that we encountered with panel data,
and we learned about two data transformations
that you can use to account for this.
And we're gonna learn a new method
on how to deal with endogeneity.
So so far, we've just been assuming,
or we transformed data such that the error term
and each one of our K regressors are not related,
that no change in the regressors
result in any change in the error term,
DU/DXk so far, it equals zero
and we assume that the covariance of U
and each regressors equals zero.
Now, what do we do when they are not equal to zero?
When a change in the regressor
does result in a change in the error term,
that is their covariance is not equal to zero?
So basically what we need is an instrument.
So we need another variable, one or more,
which is itself exogenous
and that when you sort of put in place to be an instrument
for the endogenous one.
By way of introduction,
again, this week, we're gonna learn
another way to deal with endogeneity.
And just as an aside,
a lot of what we're doing in the work after the midterm exam
is looking at ways which eliminate endogeneity
and result in an unbiased estimator,
but at a cost of the efficiency.
So keep that in mind as an overarching
(static interference drowns out speaker) as we go.
So the three main causes of endogeneity
are omitted variable.
So you forgot to ask a certain question,
or you were not able to ask a certain question on a survey.
Measurement error, where you got what you know
is a flawed example of the value of a regressor,
which I'm gonna talk about an example in my own work.
And then next time we're gonna talk about
simultaneous equations and simultaneity,
which is gonna be the theme of next week.
Last time, we learned how to difference away
or time demean away the endogeneity.
One of the shortcomings of this
is that the effect of any variable
that doesn't change over time,
especially dummy variables for gender or race
or things like that that don't change is lost
and it's a fact that cannot be predicted.
So if you think that race is an important matter,
it will be lost because presumably race or in most people,
gender doesn't change over time.
So this week we're looking at this method
of instrumental variables
as a way to deal with omitted variables
that are correlated
with the regressors and with the error term.
So again, what we're learning this week
is what to do in the presence of omitted variables
and what to do if there was a measurement error
in your variables.
And it also sets the stage for simultaneous equations,
which we will learn next week.
So far, we have learned three ways
to deal with omitted variables.
First is just to ignore it,
which we know will result in bias.
Next is to find and use a proxy.
So find another variable that we can put in place for that,
which may not always be possible,
because if you forgot to ask some question on a survey,
it's likely that you also forgot to ask that proxy variable,
or they're just simply may not
(static interference drowns out speaker)
last time we learned two first difference
or fixed effects time demean it away,
and it subtracts out of the equation.
So let's look at an example of an omitted variable.
Let's say that we are modeling, one of my favorite things,
local food expenditure.
How much do people spend on local food say per month?
So there's this model here
where local food expenditure is a function of income.
So probably folks who have higher income
would be more able to afford food,
you know, with the attributes that they want,
as well as psychographics.
So their sort of attitudes and beliefs,
just sort of this attribute of being a foodie,
being a local foodie, thinking that's important.
But there is no simple, straightforward variable,
which measures psychographics.
There's not a psychographicometer that we can measure
where someone lies on that.
And so if we don't account for it,
if we don't think about it at all,
it will go into the error term.
So this psychographics is then part of the error term.
And I think there's good reason to think
that it would be correlated with income.
That higher income folks have the means to care about
and think about and act upon expressing their values
in the marketplace and voting with their dollars
and all of that,
as opposed to, I would think, lower income folks would,
that simply would not be an important thing,
and they would have another set of psychographics
of attitudes and beliefs
about what kind of food is important.
So by omitting it, it would be in the error term,
and for reasons, I just said,
it's correlated with income.
And as we learned long ago,
omitted variables create bias.
One option is we could use a proxy.
So if we knew whether they were a member of a co-op
that we could just sort of plaster that in place
for psychographics,
thinking there's probably some overlap there,
or we can find an instrument for income,
which is likely not correlated with psychographics.
So that's the key here
is we have to find a new variable for income
that is not correlated with psychographics,
and that might be something like hours worked per week.
That while that does have some overlap with income,
it is less likely to have a lot of overlap
with psychographics.
So that might be one way to address it,
and we're gonna look at some more specific cases here.
So let's say that we are dealing with a model like this.
So back to our local food expenditure,
our X1 is income.
We know that psychographics are important.
So we can say,
we can assume that the covariance of the income,
which is X1 and our error term does not equal zero.
X1 is endogenous.
If it were exogenous,
we could use OLS and get an unbiased estimate.
So what we need is an instrument such as in the last slide,
where we talked about hours per week,
which is related to X,
but has no relationship to U.
More precisely,
an instrument must have these two attributes.
There must be two assumptions here.
If Z is to be an instrumental variable,
first, its covariance with U must equals zero,
Z must be exogenous.
It must have instrumental exogeneity.
And next, Z and X, the regressor
have to have some relationship
that their covariance must be not equal to zero.
That imagining a Venn diagram,
Z and U don't touch, but Z and X do touch.
And in this way that we're saying
that it has instrumental exogeneity
and instrumental relevance.
So laying it out here.
The first attribute that we need or the first assumption
is that the covariance of Z and U equals zero.
So Z has this instrumental exogeneity.
It is exogenous and so it'll work.
And next, it must have, Z must have instrumental relevance.
That it has to have some sort of overlap with X
on our Venn diagram.
That if these two are completely unrelated,
it won't be an effective instrument.
Note that we cannot test
whether Z and U have zero covariance
since U is not observed.
So here's another case
where we have to appeal to economic theory,
introspection, common sense, prior studies,
that we sort of use our brains,
look at past research theory and come up with an instrument
that we can make a good case,
has this instrumental exogeneity.
We can, however, test for the instrumental relevance,
that is, is the covariance of Z and X equal to zero or not?
Here, you would simply regress one on the other take X,
which is our endogenous regressor
and make that our dependent and regress it on Z.
The instrument that we will wanna use.
We put forth the null hypothesis at this Pi1 equals zero.
We use a T-test.
We hope to reject the null.
We hope that Z does have a significant effect on X,
and therefore, if we have a big
(static interference drowns out speaker) our null,
then we can use Z as an instrument.
So note that as always,
this sort of eliminating bias
comes with a cost of efficiency.
So here's sort of the theoretical formulation
of the variance of the beta IV,
the instrumental variable beta.
And note that once again,
the more information that there is in X,
so this is Sigma squared X,
how much information, what's the variance here?
Since that's in the denominator,
that makes the variance smaller,
as N increases, that makes the variance smaller.
And finally, there's this rho squared,
which is how correlated are X and Z.
So not surprisingly, as this rho increases,
which is X and Z have a lot in common.
The more in common they have, the bigger this rho squared.
Since it is in the denominator,
that makes the overall variance smaller.
And again, as N increases, that also makes it.
So here is three places
where more information implies lower variance.
The way that we would actually estimate this is through,
so note we're doing the variance hat.
How do we estimate the variance of our beta IV?
So that would be in the numerator, Sigma squared hat,
which we learned way back,
is a function of the error terms, the SSTx,
which is familiar as before,
that is how spread out our X is,
what's the total sum of squares of X?
And finally, the R squared of X and Z.
So here we want the R squared of X and Z to be big,
that these really have a lot of overlap,
that Z does a good job of explaining X,
because then we have a big R squared in the denominator,
which makes the variance smaller.
Think about which one has a larger variance,
OLS or IV, and why?
Note that
since the R squared is less than one,
that we're going to be dividing by a number less than one,
which means multiplying by a number greater than one.
But note that the higher the R squared,
the lower the variance.
The better the instrument,
the more that Z is correlated with X,
the lower variance that we have.
So again, if our R squared is small,
if Z is a poor instrument for X,
we're going to be dividing by a very small number,
less than one,
which means that we're multiplying by a larger number
greater than one,
which means that it will inflate the variance.
So again, less information, more variance.
The less new information that Z provides about X,
the higher
the estimated variance of our beta IV.
Two basic definitions for this week's work
are instrumental variables and two-staged least squares.
So we've already talked about
what an instrumental variable is.
That's one of these Z variables,
which allow us to replace it.
It can, in a sense, stand in for the endogenous regressors,
and in this way,
provide for an unbiased estimate of our betas.
Two-staged least squares is the technique
by which we let this instrumental variable stand in
for the endogenous one
and allows for unbiased estimates of the betas.
So let's say that we have a model here
where we have two regressors, Y2 and Z1.
I am using the Wooldridge
(static interference drowns out speaker) notation
that when you have a Y as a regressor,
it is assumed to be endogenous,
and we'll see in simultaneous equations why.
And then Z is exogenist.
So this is a structural equation.
This is the model that we are interested in.
And basically, what we wanna know is beta one.
What is the change in Y1, when we change Y2 much as before?
But now we are concerned that,
or we've done a test and found out that Y2 is endogenous,
and we really wanna know beta one,
but we know that if we do it just through regular OLS,
that we will have a biased estimate of beta one.
So we're gonna learn how to purge the endogeneity
and come up with an unbiased estimate for beta one.
We're assuming that Z1 is exogenous.
And since we (clears throat) need to use
an instrumental variable,
we need another one.
So we needed to have asked another question
on our survey, Z2
that does not appear in the structural equation.
So we need an instrument that's not in this original model.
So Z2 is our instrumental variable
and we will use it in the two-staged least squares.
We do this by creating what's called a reduced,
again, this is a reduced form equation.
A reduced form equation
is where you have the endogenous variable on the left side
and the exogenous variables on the right side.
In this case, there's only two.
So we started off with Z1
from the original structural model,
and Z2, which was the instrument that we had,
that we were saving in our back pockets
to use here in the reduced form.
You can also have a Z3, Z4 as many as you wish,
as long as they meet the two requirements
that they are in themselves, exogenous.
And again, at least one of them
has to have some overlap with Y2 for this to work at all.
In the method of two-staged least squares,
we literally run two regressions.
Conceptually, we're starting off
with this same structural model.
We have Y1 on the left side and we have two regressors,
Y2 and Z1.
Note that again, Y2 is an endogenous regressor,
and what we really wanna know about for our forecasting,
for our model, for whatever we're doing here is beta one.
We want a good estimate of beta one.
How does Y1 change as Y2 changes?
But we know if we just do it through straight OLS,
we will get a biased estimate.
Now, we have two exogenous variables, Z2 and Z3.
Again, we asked them on the survey
and we've been saving them.
We've been hiding them away.
We hid them in our back pockets
'cause we thought that we might need them later.
And the best instrumental variable
is the linear combination of Z1, Z2 and Z3
that does the best job of explaining Y2.
So the first thing that we actually do
is to run this structural,
or rather we run the reduced form equation,
which I'll show you on the next slide.
So here is our reduced form equation
where we have Y2 is now on the left side,
and we run OLS as a function of Z1, Z2 and Z3.
It must be that either Pi2 or Pi3 must not equals zero,
that they cannot jointly equals zero.
So we run this regression,
and then we do an F-test,
where our null is that Pi2 equals Pi3 equals zero.
And again, hopefully, when we run this F-test,
we get a nice big F-stat,
which allows us to reject our null, that they are not,
so we're rejecting the null
that they are jointly equal to zero,
and therefore they have instrumental relevance
and this will work.
So what you do is you run this reduced form equation,
and you save the predicted values, Y hat.
So you save everybody's Y2 hat
from this reduced form equation.
When we do this in SPSS, I'll show you how,
but you already know how to do that,
how to save Y hats.
So you save these Y hats.
And then we go back to the original structural equation,
and we replace Y2 hat in place of this Y2.
In this way, we have just purged the Y2 of the endogeneity,
because a linear combination of all exogenous Xs
is therefore itself exogenous.
So as long as Z1, Z2 and Z3 are in themselves exogenous,
if their co-variance with the error term
in the original structural equation equals zero,
if they have this, they are exogenous,
then a linear combination of them is also exogenous,
since there's no error term in them
making a linear combination of them will still be exogenous.
Note that the variance of our two-stage least squares beta
will be greater than the variance of beta OLS.
Take a moment and think about why this might be so.
And think about our old friend,
more information means less variance.
Why is there more information in beta OLS?
Well, here's why.
Two very closely related facts.
One is that Y2 hat has less variability than Y2,
that we're only taking that part of Y2,
which has overlap with our Zs.
So we're losing a lot of information there.
All the information of Y2
that imagining our Venn diagram is outside of,
or doesn't touch our Zs,
all of that is lost.
Plus, Y2 is going to be pretty highly colinear
with our existing Zs,
and therefore in both cases,
less information leads to higher variance.
So this is a classic case
where we are sacrificing efficiency to get rid of bias.
And this is again,
a trade-off we're going to be revisiting
most of the rest of the semester,
that when we purge or when we get rid of bias,
it comes at a cost of a less efficient estimator.
There is an order condition for this whole thing to work,
to be able to identify this Y2 hat.
We need at least as many excluded endogenous variables
as we have endogenous.
So note that,
remember, the instrumental variable
does not appear in the structural equation
that we save them,
we stuck them in our back pockets
for when we would need them.
And we need at least as many of those Zs
that are not in the structural equation
as we have Ys which are regressors.
So think about the number of Zs
that we saved in our back pockets,
and the number of Ys that appear as regressors
in our structural equation.
If the number of Ys is greater than the number of Zs,
this is under identified,
and we cannot run this model.
So if we have two Ys as regressors say, Y2, Y3,
and we only saved one Z,
that's not in the structural equation, that's not enough.
This is not identified and it won't work.
If we have the exact same number
where the number of Zs we saved
and the number of Ys which are regressors,
it's just identified and that's fine.
And if there are more Zs than Ys,
then that's fine and that's actually good
because you're gonna have more information
that goes into these Y hats when we do the second stage
of two-staged least squares,
but you'll have to have
at least the same number, if not more.
This method can also help us address measurement errors.
So let's say that you ran a regression.
So you ask three questions,
Y, X1, X2 as before,
the respondents were able to accurately answer Y and X2,
but for some reason, they did something wrong in X1.
It's not observed,
they screw up,
somehow they did not give,
either we didn't ask it at all,
or when we asked it
we asked it in a way that was confusing or biased
or led to
strategic responses,
but in any case, they did not answer truthfully.
And actually we observe X1,
which we know has an error.
So if we do a bunch of substitution,
you can see that this will appear in the error term,
and that
X1 is now endogenous,
and if we use straight OLS,
that we will come up with a biased estimate of beta one.
So I actually, I wanna give you a concrete example
of when this could have been used in my work.
So back when I worked in Michigan,
we did the equivalent of the Vermonter Poll.
So I think it was a,
I forget what it was called,
but it was the university drew a random sample,
asked a bunch of questions,
researchers like me could buy questions on it
and we got the data.
So the subject of this project was farmers' markets.
And we asked folks,
we went back to August of the last year and said,
how much did you spend at farmers' markets
in August of whatever the year?
I think it was 2007, say.
And when you added these all up and extrapolated them out,
the respondents grossly overestimated
that when you looked at,
if that's actually how much households spend
times the number of households,
it was a ridiculously large number.
So due to something like social desirability bias
or other factors,
they really overestimated how much they spent.
Luckily, we asked,
how many times did you go to the farmers' market?
So we were able to use this number of farmers' market trips
as an estimate of how much they actually spent.
I think most folks could pretty accurately,
let's see, in August I went once or twice or three or four,
or whatever,
rather than, how much did you spend?
Which we know was a gross overestimate.
Here, we have another observation of X1 star.
Here would be the example of number of trips.
So as long as the Z1 is not correlated with the error term
in the structural equation,
that we could run a reduced form regression
where our observed X1 is on the left side,
our Z1 is on the right side,
we save these X1 hats through two-staged least squares,
put it back into the structural equation,
and then that way we can learn what beta one is,
that what is the effect of farmers' market expenditure
on our Y?
There is, as you might imagine,
a test for endogeneity
and it's a fairly straightforward one, I hope.
So we start with this structural equation
where we have a Y1 on the left side,
and we have Y2, Z1 and Z2 as our regressors.
We suspect that Y2 is endogenous.
And again, our (indistinct) would come through
economic theory, introspection, previous studies,
common sense,
but we have good reason
to (static interference drowns out speaker)
Y2 is endogenous.
And we did save two potential instrument, Z3 and Z4
that are not in the structural equation that we saved.
We kept them in our back pocket
so that we could do a reduced form model for Y2.
And here is our reduced form equation for Y2.
Note that it has Pis,
which helps you know that it's a reduced form.
So we wanna test if the V2, the error term from this one.
So once we've already netted out all the exogeneity.
So we've already purged Y2
and we wanna know if the leftover error term V2
is correlated with U1.
And here, we run a regression.
So we've saved the U1s from our original equation
and we also save the V2 from the reduced form,
and we obtain our V2 hat from the reduced form equation
and we save that.
So we go through and we save our residuals,
which again, you know how to do in SPSS
and I will show you how to do that when we do it,
and we'll run through an exercise.
So we've saved our V2 hat,
and now we add that as a new regressor
into our original structural model.
And we do a T-test on this Delta one.
And in many cases, it's best to use
a heteroscedasticity robust T-test.
So we would use the heteroscedastic robust standard errors
to get our T-stat.
So the way that you would interpret this
is if Delta one,
so our null hypothesis here is Delta one equals zero.
A big T-stat means that we can reject the null,
and in this case, we hope that we fail to reject the null,
that if we fail to reject,
that means that V hat has no overlap with Y1,
it means that Y2 is exogenous
and we can just run OLS as before.
Whereas if we run the test,
we have a big T-stat, we fail to reject,
then we conclude that Y2 is endogenous
and we have to go the two-staged least squares route.
So that is the end of the slides.
And I hope you have a chance to look over these,
and please write down things that don't make sense
and I will spin through them
hopefully fairly quickly on Friday,
I mean, sorry, on Wednesday,
and then we'll do SPSS on Friday,
and then we'll be done with IV two-staged least squares.
So I hope you are all well,
and I enjoy seeing you on Microsoft Teams,
but no, I really, really still miss seeing all of you
in person.
Take care of yourselves, take care of each other,
check in on each other.
Let me know if you need anything.
And, you know, again, in my role as your professor,
in my role as the coordinator of the MS program,
or just in my role of someone who cares about you,
let me know if you need anything
and I'll see all of your electrons on Wednesday.
Thank you.