[Instructor] Now, I'm gonna show you how
to estimate an equation,
both for all the respondents
and also how to split the sample
into two groups so that we could do a Chow test.
So the first thing that I'm gonna do is
to run this model right here where,
this model estimates how much sleep
that an individual gets based on how much they work,
their education, their age,
the square of their age, and whether they have young kids.
So we go to the dataset, and we do a linear regression,
where sleep is the Dependent
and then the Independents are the total work, educ,
age, age squared, and the last one is young kids.
So this looks at just these variables.
And note that we're not controlling here for gender,
that we do have a dummy variable, male,
but we're not going to use that yet.
So we're gonna say OK.
We look at the results, and we see that,
again not a huge R-squared, this is as before,
that R-squared is the regression divided by the total.
It looks like it's .115.
And then, here, we see that the only significant value is,
well, total work is and education is, it's significant,
just barely.
So the more that you work and the higher education
that you have, the more that you sleep.
So now, we're gonna say, "Does gender matter?"
Well, one of the ways that we could do that is
to just include the dummy variable male.
So let's do that.
Let's go back to our data and run the same regression,
except now we're just gonna add male to it, and say OK.
And when we scroll down,
we see that male is pretty significant
and with a strong positive beta.
So being male means that you sleep more.
So two ways that we could do this is to,
if we think that the effect of male on work, and education,
and age, and all of these other things is different
for males and non-males, we could create interaction terms.
And I actually did that.
So I'll show you what that looks like.
The way that you would do that is to transform and compute.
I won't actually do it, but you could do,
name it something, and then call it the equals male times,
and then say age, and name it that.
I already did that.
So you'll see that in the dataset,
but that's how you would do it or that's how I did it.
But we're gonna get rid of this.
So now, let's run it with all of those interactions.
So again, we're just gonna run a linear regression.
We're gonna leave all those things in.
And now, we're also gonna add all these interaction terms.
And note that,
we're gonna lose a bunch of degrees of freedom
by doing this.
But let's see what we get and let's look at the results.
So again, we added a regressor so R-squared goes up.
And now, we see that, really,
these are not very significant.
We see male is no longer significant,
but age and age squared are just barely.
So work is, and male, young kid is barely.
So the last thing I wanted to do is to run a Chow test
and we're gonna get rid of all of these regressors
that have male in them, but we're gonna split the sample.
So the way that you do that is,
you go to Data, and we split our file,
and we are gonna Compare Groups by male.
So we put male there.
We say OK.
Make sure that,
so this is the kind of thing that you have to sort
of turn on and off.
So if you don't want,
you need to go back there
and just re-click Analyze All Cases, which is the default.
So now, what we're saying,
do males and non-males sort of experience sleep differently?
Is our better model having a separate set of betas
for males and non-males?
So here, we're gonna do the same thing, a regression.
Now, we need to get rid of all of these
because these would be perfectly colinear
because they would be all the males.
It would just be a column of one.
All the females for all of these,
it would be a column of zeros.
So we need to get rid of those or the model won't work.
And let's make sure that we're back to where we wanted,
total work, educ, age, age squared, young kid.
And note that we split the sample,
so we're gonna see it as two groups now.
And then, we say OK.
And it did that.
So you see that we could get our own R-squared
for both males, which are coded as 1,
and non-males, which are coded as 0.
Nice big F-stat.
Each group gets its own R-squared.
And then, also, each group gets its own coefficients.
So this is the non-male group here.
Work is significant, and that's it actually for both groups.
Now, what we would do is to run a Chow test.
And I'm gonna go to my Excel spreadsheet here.
And I've gotta make sure that you can see this.
So we ran it as a pool.
So we're looking at the sum-of-squared residuals
for all of these.
And this number comes from,
let's go up to the very first one that we ran here,
it's this, the number right here.
So before we split the sample,
so you could copy and paste that.
And then, the other two numbers come
from our last regression, the residuals for each group.
These are for non-males and this is for male.
So we take this number, and this number,
and put it into our spreadsheet.
And I did the math here,
and the numerator and the denominator here,
the various degrees of freedom,
and our F-stat is 2.12 and the critical value is 1.77.
And I think I can show you that on the table,
where it's six degrees of freedom
and an infinite number at the 0.10 is 1.6677.
At 0.05, it's 2.21, it looks like.
So it's very close.
So since it's bigger, then,
we would reject our null that males
and non-males have the same coefficients.
And we would say that running the model
as two different groups is the better model
as a result of our Chow test.