Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: re: binary variables

From   Natalie Trapp <>
Subject   Re: st: re: binary variables
Date   Thu, 03 Jun 2010 17:16:54 +0200

Thank you so much for all the comments. They were very helpful.

@Martin: I am not so convenient with Stata, so I haven't found out all the tools yet. Though I made the dofile, which generates the binary variables, with the GAMS program; so it wasn't much work.

@ Maarten: Ile de France, in my dataset is not Paris only but also the districts surrounding the city, so I do have 94 observations in this region. Other regions that are not omitted may have even less observations, or regions that are omitted may have many more observations. This wouldn't explain why Stata omits these variables.

I think the "areg" command is not appropriate as I have several different crops growing on one farm, so that I have several observations for one individual and included an indicator for each individual.

The "xtreg" command works very well, although I am still not sure about the disadvantages of a fixed effects model. And still the problem will remain when I want to explain the differences between regions.

Maybe there is a similarity between some regions that are not obvious, so I have to aggregate some regions.

So, thank you very much once again. You gave me many more ideas!

On 6/3/2010 11:58 AM, Christopher Baum wrote:
Natalie said

I also couldn't sort out how to make the "xtreg" command work. It gives
me the error "not sorted r(5);", even when I sorted the data and then
typed the "xtreg" command (maybe because there are too many variables or
maybe because I have cross sectional data?!).

I imagine you tried to include those explicit region variables (Saarland Brandenburg MeckPomm Sachsen, etc.)  in xtreg, fe. You can't include region dummies and fit a fixed effects model.  All you need to do is

xtreg depvar indepvars, fe i(REGION)

and Stata will fit the model using the within transformation (equivalent to including dummies for each REGION).

To see that this works:

webuse grunfeld
tsset, clear
xtreg invest mvalue kstock, i(company) fe

Note that the sort order does not matter. You can randomly sort the observations in the dataset and the above FE model
will still work.


Kit Baum   |   Boston College Economics&  DIW Berlin   |
                             An Introduction to Stata Programming  |
  An Introduction to Modern Econometrics Using Stata  |
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index