0
$\begingroup$

So basically I understand that in stata, one should utilise XTSET to declare panel data and then xtreg for the regression so for instance:

(xtreg dependentvariable independentvariable1 independentvariable2 independentvariable3, 

fe)

The fe at the end is fixed effects but am slightly confused about exactly which variable adding a fe at the end is fixed.

Because if the independent variable is time invariable it would automatically be omitted by stata, so the fe at the end, is fixing, for instance, company, year or can this be specified? thanks!

$\endgroup$

2 Answers 2

1
$\begingroup$

Let's say your panel data is composed of observations (time points) nested within people. So for each person, there are some number of observations corresponding to different time points. There is some variable (call it "ID" or "name") that tells you which person each observation corresponds to. You run a model with xtreg predicting some time-varying dependent variable as a function of some number of time-varying or time-invariant variables. In stata, adding "fe" to the end of a model like this is the same thing as adding a separate dummy variable for each person identifier. In other words, if the id variable is called "id" then these two models will produce (basically) identical results

xtreg depvar iv1 iv2 iv3, fe

xtreg depvar iv1 iv2 iv3 i.id

The only difference is that the "fe" model won't actually bother to show you the coefficients for the various dummy variables - which you probably don't care about anyways.

In both cases, what you are doing is using dummy variables to control for all between-person differences, allowing you to only focus on changes WITHIN a person (hence fixed effects models are sometimes called "within effects" models). In a sense, it estimates a separate intercept for each person. This is why, however, you specify it, time-invariant variables will drop out of the model because they are colinear with the dummy variables.

The alternative way to run a panel analysis is a "random effects" mode, which is the default with xtreg. Instead of estimating each person's intercept separately, this approach assumes that these intercepts vary randomly around the overall intercept. The benefit of this approach is that it allows you to include time-invariant variables in your model, but on the other hand, this approach does NOT fully control for between-person differences, like the fixed effects approach.

Multilevel modelling - which is what all of this is - is a really complex topic with lots of complexities that I have glossed over here. Stata Press has a really good textbook that walks through a lot of these issues though.

$\endgroup$
0
$\begingroup$

To answer this question more specifically I would like to know a little bit more about your variables and de research you are performing. But here's an example.

When investigating the effect of having health insurance on mental health for 65+ aged people, with control variables gender, ethnicity, years of education, BMI and income: fe includes gender, ethnicity and years of education. So when adding both fe at the end and these variables as controls they will be omitted by Stata. So in more general terms: all independent variables that are time-invariant for that individual are captured in fe. Depending on which variables you have, these fixed effects can be specified on certain levels (individually, group-level, etc.).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.