[Instructor] Hello, and welcome to the SPS exercise
for panel data two for CDAE 359 Applied Econometrics.
So I did a bunch of the data transformation already.
What I'm going to show you,
and I made this claim in class
is that when you only have two time periods
that the fixed effects time demeaning
and the first differencing data transformations
give us the same betas.
So you can see that this is data from 64 cities on rent,
and it looks at rent, which is our y
as a function of population of the average income,
the log of average income
and the percentage of student population.
And there are 64 cities.
And it looks at,
well, what is the effect of these three regressors on rent?
And it has data from 1980 and 1990.
And so the first thing I did was to transform the data.
And I actually did this in Excel and then copy pasted.
So it shows it here as one and zeros
because it's such a small number,
but basically for each city.
So you can see that it's arranged here,
cities one all the way down year, year, year, year.
And for each of these, I just subtracted.
So this is the change in the log of population,
subtracting zero from 1990,
from 1980 same way.
But this is our dependent and et cetera.
And in a minute, I will show you
how I transformed the data for fixed effects.
But this was the data transformation.
And this C in front of it here means that it's the change.
So it's the 1990 value minus the 1980 value
for each of these cities.
So let's run a regression, and it's a little linear.
And our dependent is the change in the log of rent.
Just wanna make, go back to the sheet
and make sure that I'm doing this.
Clpop, Cl average income and C percentage student.
So clpop, boom, cl average income
and change in percentage student
Nope, we do not put our dummy variable for 1990 here.
That kind of wouldn't make sense to
because it's only gonna, it would be,
since we subtract out, it would be a,
it would be one or zero for every row.
And that would be a,
you can't have a constant as a regressor
because it is perfectly colinear with the intercept.
So let's just run this now.
Boom, and here are the results.
And I want you to look at the beta.
So there's two things significant here.
Or three, actually, sorry.
The only one that's not is the change in population,
but both the average income
and the percentage of students has a positive sign,
and is significant.
So what what that means is
as the average income changes in a given city,
and as that the percentage of students changes
in a given city that results in on average
a change in the average rent in that same city.
So let's look at the other way to look at it.
Now, I'll make this small.
And the other thing I did was did a fixed effects.
So here I'm putting,
I took the mean here, and I just subtracted it.
So fixed effects, L rent,
fixed effects Log of population,
fixed effects average income
and fixed effects percentage mean.
Note this pattern here,
and this would make sense that in a given city
that these will just be the same number in opposite sign.
So it's the mean would be halfway in between these two.
So since there's only two, this is minus 2.8 under the mean.
And then in year, the second year,
it's that same amount over.
You can see this pattern
for all of the fixed effects data transformation.
And that makes sense.
I hope it makes sense that it would be that way
for this T plus two.
So let's do a regression again.
And we do, again a simple linear regression.
We can reset it.
And now it is, our dependent is this fixed effects,
L rent as a function of fixed effects.
L pop, fixed effects.
Log average income, fixed effects,
percentage student,
and to control for the year
because there's one observation per year,
and it makes sense to include it,
we include the dummy variable for year 90,
which is one, if it's a 1990 observation.
Zero, if it's a 1980, and then we hit okay,
and we look at the betas and note that they're the same.
Let's go up and see and note that these betas
for pop average income and percentage students are the same.
And note that now the year in the 90 is now
the constant.
That's the same figure.
But the key here is that these three betas are the same.
And the point of this is to show again, when T equals two,
it doesn't matter if you first difference
or time demean fixed effects.
It doesn't matter which data transformation that you use.
The betas are the same.
So thank you for watching.
Bye.