- [Professor] Hello everyone,
and welcome to the final exam review for CDAE 359.
So our agenda here will just be to go over
what's gonna be on the exam,
starting with a few announcements
and then,
go over the actual topics.
Here's what we'll be running down today.
So starting with two
big related concepts,
and then going through the basic topics that we've done,
limited dependent variable and sampling corrections.
panel data,
instrumental variable, two-stage least squares
and simultaneous equations.
And this is the material that will be emphasized
on the exam.
The exam is cumulative,
but only to the extent that concepts
and principles we've learned
early on carry through,
but the questions will very much focus
on these specific topics.
The two biggest relationships that I wanted to talk about,
the two big concepts are first,
a lot of what we've done
in the second half of this class has been looking at
the trade-off of consistency or bias and efficiency
that in many cases,
the techniques that we use
to eliminate bias are at the cost of efficiency
that they make the variance
and standard error of our betas increase greatly.
And we found this with random effects
and instrumental variables, two-stage least squares
and have learned two tests.
One that I'm gonna go over,
pan a little bit more depth,
mean square error,
as well as the Wu Hausman test
or the Hausman tests that we learned
when we were working with panel data.
The other one,
and there was a lot of focus on this concept is endogeneity
and we recall that we assume and hope,
and if we have well-behaved data
that the expected value of the error term
for any value of X equals zero,
that the covariance of the error term
and any regressor equals zero.
And therefore we can say that X is exogenous,
and this is what we want.
This is well-behaved data.
And this is one of the absolute foundational requirements
to have an unbiased estimator.
And we've learned that if this is not true,
if the covariance does not equal zero, then X is endogenous.
This causes bias.
And just as a review that we wanna know the value of beta,
how does Y change as X changes, all else equal.
Really what we wanna know is how does y hat change
as X changes,
that how does the expected value of Y change as X changes
and because we cannot observe this,
and if the error term
and any regressor are correlated,
if they're covariance equal zero,
if du/dx does not equal zero,
we cannot tell if a change in X result
in a change in y hat or in u.
And therefore this results in a biased estimate.
Two tests that we learned are mean square error
and the Wu Hausman test.
And we'll talk a bit more about this.
The Hausman test we learned,
and you covered pretty extensively on your homework.
Mean squared error is the square
of the bias plus the variance.
So I'm gonna show you a bit more how this means.
So let's say that we have an endogenous regressor
and we wanna know its beta and which one should we use.
So we can run both OLS
and use this, IV two-stage least squared method.
And just to keep things clear,
let's call, when we run it by OLS,
that this B is beta o.
And when we run it by instrumental variable,
we call this beta i.
So the mean square error is the bias squared
plus the variance.
So for the instrumental variable,
since there is no bias,
it's just zero squared plus zero
plus the variance of beta i.
To get the mean square error of beta o,
we subtract beta i minus beta o.
So we subtract the biased from the unbiased value
and square that,
and then add the variance of beta o.
And whichever of these has the smaller value,
the mean square error of beta i,
or the mean squared error of beta o,
then this test would suggest that that is the one
that we use.
Now to get into the topics of specifically
that will be on the exam.
So the first thing we did
after the midterm was to look at LimDepVar,
the limited dependent variables.
So we learned
that not all dependent variables meet OLS requirements,
that in theory,
the Y in OLS should be able to take any value
of negative infinity to positive infinity.
And while we don't, you know,
certainly see all those become used,
ones that deviate far away
from that will be more problematic.
And we see this a lot,
some are nominal or ordinal.
Some naturally take on small integer values.
Like how many cars you own,
or how many times you've been arrested.
Some sort of naturally pile up at zero
due to behavior,
such as how many cigarettes
that you smoke or how much that you spend on alcohol.
Many people would say zero for this.
And then,
sometimes our dependent variable cannot be measured
outside of a certain range.
So in these cases,
we need to do methods other than ordinary least squares
to get a good estimate of them.
And then next,
there are times when we don't have the perfect random sample
where we can observe everybody, as we hope.
Sometimes we choose to only focus on a sub sample,
because that's what we are interested in,
or that's all that we can reach.
And then there are also times
where only the participants can be observed.
So we talked a lot about the case of women's wages
in the workforce.
And this was at a time
when many women did not work from home,
they were not in the workforce.
So only the wages
of those who are in the workforce could be observed.
And we'll talk more about that in a minute.
So here are the categories of LimDepVar
that we talked about, binary, ordinal,
tobit, hurdle, Poisson and censored.
The last type of limited dependent variable is censored.
And in this case,
we either choose
or are only able to measure our Y's
within a certain range.
And you can think of it as a scale
that maybe only goes up to 300 pounds
and anybody who weighs more than that,
we can't observe how much they weigh.
And we talked about
very often, we put income in categories,
and that would be another example
where if it's above this amount,
that all we can observe is that it's up to that point.
So in this case,
we can't use OLS.
We have to again, use maximum likelihood,
but the betas can be interpreted directly.
So it is a constant, it is dy/dx
unlike the probit,
logit, tobit and ordinal,
and all of those that we learned about.
Another topic that we covered this week is so far
when we're talking about LimDepVar,
it's properties of our dependent,
and now we're gonna talk about some properties
of our sample.
And this is called truncation where,
because of our researcher choice,
we can only observe,
or we choose to only observe part of the population.
So only folks
of a certain income,
higher income or lower income
or houses worth a certain amount,
more, greater or less than that.
Here we use T-tests
and log likelihood tests
to measure this.
One of the more interesting parts
of truncation is so-called incidental truncation,
where we can only observe participants
in sort of more broad in truncation
that we could observe higher income folks behavior
and get data from them,
even though we're only interested in lower income
or we choose to put our attention to lower income.
This incidental truncation is a case
where we can only observe participants.
So if we wanna measure the returns
of college education to income,
that we can only observe those who went
to college to have that effect,
or the classic case of women in the workforce,
where we can only observe that wage
of those who are in the workforce.
And so in this case,
the participation is endogenous.
And we have to estimate this with two steps.
And this is a fairly
commonly used model in econometrics.
Now we're gonna jump to panel data.
Before this, we've worked exclusively
with cross sectional data.
So only one time period
and with many observations.
But now what we're going to work with many observations
over many years.
So now T is greater than one and N is greater than one.
As an aside, up till this point we had only worked
with cross section,
T equals one.
So data from N participants
in a single time and time series is data
from a single participant
over many or looking at a single variable
over many years like income or GDP
or prices or anything like that.
So panel data is when we have both T
and N are greater than one.
In a sense, panel data combines both cross section
and time series.
And there's two main types.
First is independently pooled cross section,
where you are asking the same questions,
measuring the same variables over time,
but each time you're drawing a random sample.
So an example of this is asking the same question
on the Vermonter Poll over multiple years.
Whereas true panel data,
you're following the same subjects
and keeping track of what each individual said
for each variable over each time period.
One application of this independently pooled
cross section is the difference in differences model,
which is sort of a natural or quasi-experiment
where we have a treatment that takes place in one,
say one area,
but not in another.
And then we measure the before
and the after effects of this.
So we choose two areas.
One gets a treatment,
one gets the control.
We take a baseline reading of a random sample of those areas
in the first time,
then the treatment happens.
And then we take another reading in time too.
And you can see here that
the coefficient of interest is delta one here.
That is the effect
of the treatment in time two,
controlling for the treatment area
and the passage of times.
So, this delta one isolates the effect of the treatment
and as a result of the true treatment and in time two,
so what changed from time one to time two
in the treatment area,
controlling for both treatment and time.
On the other hand,
(mic screeching)
true panel data,
you're not taking a random sample each time.
It's not a new sample each time
that you're actually following the same individuals
or the same units of analysis
over multiple years
and keeping track of who says what.
So when we talked about this city market measurement
of their members,
where they follow me say over many years
and keep track of what I said to each question in each year.
This tends to have usually a fairly big N and a small T.
The problem is there is unobserved individual heterogeneity
that there are things that just make me, me
and make you, you
that are very hard to measure
and that we can think of as almost certainly correlated
with our regressors,
so we have to account for those.
How do we account
for this unobserved individual heterogeneity?
Well, we could have a dummy variable for each individual.
The problem with that is,
especially in a single time period,
you're gonna end up with negative degrees of freedom.
And in any case,
you're gonna have a whole lot of regressors.
So you're gonna have N dummy variables
for N individuals for whom you have data,
and that really eats into your degrees of freedom.
But we know that if we ignore it,
that this will go into the error term
and it will cause bias estimates
of all of our betas of interest.
So we have to deal with it in some way.
We learned about two ways and I'll go through each one.
The first differencing and these,
the fixed effects, time demeaning.
And note that if we were to run OLS on true panel data,
that this results in a bias estimate
that it will probably be more efficient,
but it will almost certainly be biased.
And that it is unbiased only
when we draw an independent,
random sample,
a new sample every time does that get rid of the bias.
And if we keep sampling the same people over time,
running it as pooled OLS will result in bias.
The first method that we learned with is first differencing.
So here,
we keep the individual persons observations together,
and we subtract time t from time t minus one.
So we take the difference of how say NMI
in this city market example
of how much I spent in 2017
and subtracted how much I spent in 2012.
And so we get the delta y
and delta x here.
I think you can see that the ai drops out by subtraction
because it's the same thing every time.
One thing that we need is for the delta x's and delta u's
to be uncorrelated.
This is called the strict form,
a form of strict exogeneity
that the covariance of all of my X's
over all times
and all of my error terms equals zero
by running the regression on this bottom equation here,
the change of my y as a function of the change in my X
that beta that you get there is called
the first difference estimator.
This technique, first differencing,
the two big pros of it if it does eliminate bias,
and if you have serial correlation,
it helps to get rid of the serial correlation of the errors.
The drawbacks is you lose a whole observation.
So if you have data over two years
for each individual,
now you only have one observation,
or if you have three years, it's down to two, et cetera.
So you only get t minus one observations for each person.
Since we're subtracting out,
we're only measuring the change in X,
you're probably going to have less variation in X.
We lose any information that might be contained in ai
because it's subtracted out.
And as a result,
because we lose degrees of freedom,
we lose information each time.
This tends to be a less efficient estimator.
The other technique that we learned to deal
with panel data is fixed effects or what,
where we do the time demeaning.
So if we have one regressor,
we still have this model
where we have data from each individual
over t times.
And we assume that there's this ai there
for every individual.
Now we group each individual's observations.
So you say, take all of my observations
and take the mean of them.
So if I answered the survey three times,
take all three of my Y's,
and take the mean of them.
So that's yi bar same with xi bar and ui bar.
And then we subtract them from each time observation.
So say in year three,
you take my Y and subtract
the mean of my Y and the same for each X,
and in this way,
since ai doesn't change
over time with the mean of ai is always ai,
it gets subtracted out.
And in the same way,
it gets rid of this endogeneity
and therefore the bias.
And this could be done for any number of K's
and for any number of times.
So if this were pooled,
the data that you would have NT observations,
but we lose,
but the degrees of freedom
here is NT minus N
because we lose a degree of freedom
by subtracting out the mean,
and then k for k regressors.
So the pros and cons of panel data,
it does eliminate bias as well.
And compared to first differencing
for any number of times greater than two,
it retains a degree of freedom.
It keeps one more observation
than it does per person
than when first differencing.
The cons is same as first differencing.
Any predictor that is constant over time will be lost.
It gets subtracted out,
and it does not deal with serial correlation
in the way that first differencing did.
And you need a homoskedasticity
and a lack of serial correlation
for this to be an efficient estimator.
This slide discusses the difference
between our two techniques,
the first differencing
and time demeaning fixed effects data transformations.
So, as we saw in the SPSS exercise,
when you had two time periods,
you get identical betas.
If T is greater than or equal to three,
then you have some decisions to make.
So they're both unbiased,
as long as the other
classic linear regression assumptions hold.
And in many ways,
it comes down to if there is serial correlation.
So when we do time series,
we'll learn how to test for that.
So if there is no serial correlation
then time demeaning is more efficient,
in many ways,
because you have one more observation to work with.
If there is significant serial correlation,
then it's better to use first differencing
to eliminate this.
And also when you have a large T,
so when T is large and N is small,
it comes more of a time series model
and first differencing is better.
And as is so often that the case,
it's good to do things both ways
and to discuss why and how they differ,
and which is the final model that you choose.
The last data transformation that we can do
in panel data is random effects.
And we have our same model where we have
N research subjects, data collected over t times,
we have k regressors,
but now we can assume that ai is uncorrelated
with any of the Xs at any time,
which basically means that we've controlled
for everything through our Xs,
and therefore ai is very small and insignificant.
And by doing the time demeaning or first differencing
we lose information
and therefore those betas are less efficient.
They have a higher variance.
So this is a form of FGLS.
And here you can see Jeff Feagles
when he was a punter for the New England Patriots.
And anyway,
we weigh every observation by a factor of one minus lambda,
and we use our data to come up with the lambda,
and you can see that the lambda is a function of
the variance of our error term,
which we've worked with before,
the variance of our a term and t,
how many observations that there are.
And then we use this lambda to weigh every observation.
So,
we weigh the mean
by this factor.
And in the next one, I will show you what this all means.
So again, this is our lambda.
So with lambda equals zero,
then we don't subtract any of the mean out,
no wrong.
If lambda equals zero, then it's the same as fixed effects.
We subtract all of our mean out.
If lambda equals one, it's the same as pooled OLS.
We do not subtract any of it out.
And in most cases, it'll be a number between zero and one.
Note that if a varies a lot, a is important,
and the sigma squared a is large
than one minus lambda approaches one,
and it becomes more like the fixed effects,
which we would assume if a is important,
we need to subtract it out.
As T gets large,
one minus lambda,
again, the approach is one,
and it becomes like fixed effects
and as a got smaller and smaller,
one minus lambda approaches zero
and it's more like pooled.
We learned about the Wu Hausman test
or Wu Durbin Hausman tests, it has a number of names,
but this test that W,
in the numerator is the difference
between the two betas,
the random effects and fixed effects squared,
and on the denominator is just the difference
of the variances.
So you would run it both ways.
And for a given beta,
note, what is the estimate of beta?
Those two things go in the numerator
and what are the variances of these?
So you would take the standard error from the SPSS
and square it,
and those are used in the denominator,
our null hypothesis is that this X and ai
that their covariance equals zero.
So if the null is true,
if the covariance of those two things are zero,
then the numerator is small.
There's very small or no bias.
The denominator is large
because we,
there a big difference in the efficiencies,
W is small,
and we use random effects.
If the test stat is large,
which means a lot of bias
and not very much change in variance.
So big number in the numerator,
small number in the denominator means a large test stat,
which means that we reject the null
and we use fixed effects.
Now we jump to the next topic, (mic screeching)
instrumental variables and two-stage least squares.
So this is another data transformation
to deal with endogeneity.
You may notice (paper screeching)
a trend that that's a lot
of what we were doing in the second half
of this class is transforming data
to deal with endogeneity.
And again, finding that in almost every case,
the eliminating bias comes at a cost of efficiency.
So this is a method that we use to address endogeneity.
Its applications in omitted
with variables and measurement errors,
and most commonly is used in the next topic
that we covered simultaneous equations.
So we've talked a lot about this,
but just as a review,
that endogeneity causes bias,
that if the regressor and the error term are correlated,
that we can't know (paper screeching)
what is the direct effect of x on the expected value,
because we can't partial out
the way that x affects u,
and then u affects y.
So this is why failing to deal
with endogeneity gives us bias assessments.
So the three main ways that it,
or the three main sort of types of data that we have,
or three main issues are omitted variable,
where we are missing the variable where we,
our regressor has an error (paper screeching)
and how it is measured or simultaneity.
So far,
what we've learned is we could ignore it,
but we know that causes bias. (mic screeching)
We could find a proxy that is exogenous,
which may or may not be possible.
We can assume it is time constant.
And in panel data subtracted out through first differencing
or subtract out its mean through fixed effects,
or we can use the instrumental variable method.
So this method requires us
to have an additional regressor
or an additional variable
that's not in the original equation
that we sort of saved in our back pockets.
And it has to has two attributes.
First, (mic screeching)
it must be in itself exogenous.
So the z must have zero covariance with u
but it has to have some sort of explanatory power of our x,
so the z and x cannot have covariance
(mic screeching)
So in two-stage least squares,
we start with our structural models.
So we have Y on the left side, Y1,
and we have this endogenous regressor, Y2,
and an exogenous one in our structural equation, Z1.
We've also saved two exogenous variables, Z2 and Z3,
which have these two attributes that they are exogenous.
So they're both uncorrelated with u1,
but they do have some overlap with Y2.
So we wanted it to come up
with an estimate of Y2,
which is a function of Z1, Z2, Z3,
that has the most explanatory power that we can.
We do this by doing the first stage
of two-stage least squares,
which we put Y2 on the left side,
and we regress it on all three of our exogenous regressor,
Z1, Z2, Z3.
We do an F-test,
and we hope that we can reject our null,
that we hope that Pi2 and Pi3 are not jointly equal to zero,
that these two,
Z2 and Z3 have significant explanatory power for Y2.
Then we save the predicted values of y hat.
So everybody's y2 hat gets saved.
And then in the second stage of least squares,
we put this Y2 hat in place of the Y2.
And in this way,
since Y2 is a linear combination
of all exogenous regressors,
it is in and of itself exogenous.
And this purges the Y2 of its endogeneity.
Note though, that it comes at a cost
of much higher variance.
And we saw that
when we did the simultaneous equation exercises,
the standard error increased almost tenfold,
and two very related things
that Y2 has a lot less variability,
or y2 hat has less variability,
and more importantly,
maybe Y2 is very collinear with our Zs.
This method can also help address measurement errors.
So if one of your regressors,
if there is an error in which it was measured,
that will in and of itself cause endogeneity.
So if you have an instrument for the variable
that was measured in error,
that you can do two-stage least squares just as before,
and so in this case use Z1
as an instrument for X1,
and save X1 hat,
and then put it into the structural equation.
And again, this will eliminate the bias,
but as a cost of less efficiency.
The most common application is simultaneous equations.
So we showed how
simultaneity is a major cause
of endogeneity that when you have this
two directional causality,
that modeling it as a one way can cause bias.
And it tends to be jointly determined variables,
and often in equilibrium.
Very often we have a two equation, supply and demand
with Y1 on the left side of the first equation,
and it has a regressor in the second, Y2 on the left side
of the second equation
and has regressor in one,
and then each one also has a set of Zs,
Z1.
So, you know,
that that could be a number of things that affect supply.
Z2 would be a number of things that affect demand.
Here it is, spelled out a bit more.
Note that we would expect
that there would probably be some overlap
that some of the regressors
in the first equation would also appear in the second
and vice versa,
but they cannot be exactly the same
that for each equation to be identified,
there must be a Z in the other equation,
because if Z1 and Z2 are all exactly the same,
then when we do the,
in the first stage of least squares,
our say, Y2 hat will be a linear combination
of Z1.
And then when we put that back in,
it will be perfectly collinear with our Z1,
and it will not work.
Again for-
We can use two-stage least squares
to our simultaneous equations.
The way that we do this is we,
that if we're mainly interested in the first equation,
so that's really the structural equation
that we're most interested in.
Then we do a reduced form of the second equation for Y2.
So we put Y2 on the left side
and we regress it on all of our Zs,
all of our exogenous Zs, and save the Y hats,
and then put this Y hat two into the structural equation
and use that to regress for the structural parameters.
Here is a note on the directions for the exam.
So this is the first thing you'll see in the exam.
And mainly that this is take home and open book
that you can and should use class notes,
slides, both textbooks,
the textbook slides,
and also that Dartmouth guide.
So all of those are absolutely fair game for you to use,
to answer these.
It will have four, 25 point questions
for a total of 100 points.
The biggest thing is that
unlike the problem sets
that I want you to work on this only as individuals,
please do not collaborate on it.
Once you open it,
don't discuss any of the questions or the answers
with anybody else.
So do your own work.
You can use any resource except for another person.
So here's a place
where I really wanna test your individual knowledge.
So we'll go over these slides on Monday in class,
and I hope you are having a good weekend.
It's not the very best of weather to be outside,
but,
I hope that you are all well.
And we'll check in on Monday, thank you.