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]

st: RE: xtmelogit questions , thanks!

From   Maarten buis <[email protected]>
To   stata list <[email protected]>
Subject   st: RE: xtmelogit questions , thanks!
Date   Fri, 7 Jan 2011 08:43:49 +0000 (GMT)

--- Zhang Libin wrote me privately:
> I happened find your answer on ifference between xtlogit, xtmelogit,
> gllamm at
> My dissertation is a 3-level model on binary outcome (obesity or not),
> and I'm using stata for programming. 
> Level 1: individual sociodemographic factors; diet, physical activity.
> (N=9000)
> Level 2: community factors; (N=200)
> Level 3: Gini coefficient in 9 different states.  (N=9)
> Since there are only 9 provinces, I'll keep the level 3 as fixed effects. 
> 1. How can I turn the three level model into two level model by using
> xtmelogit? Meanwhile I still need GINI in the model. Can I do that?
> 2. I am not familiar with xtmelogit. Could you give me any sample codes
> so that I can figure out where to put the ID variables if STATA needs ID
> variable as SAS do?

The idea behind statalist is that you do not contact its members privately
as is discussed in the statalist FAQ:

Regarding your first question: 
I suspect that with fixed effects you mean adding dummies for countries.
This is a fixed effects estimator if your model were linear, but in 
non-linear models that is no longer true. You can find an explanation of
this point (for the case of ordered logit) here:


They also make the point that if your samples whithin each country is 
large enough so that you would be comfortable to publish analyses on 
each country sub-sample seperately, then adding dummies should work
reasonably well. I guess that is the case for your study, but I would 
avoid the term "fixed efects" and instead say that you added country 

You can add gini coefficients and country dummies if each country is
observed multiple times (e.g. multiple years) and the gini changes
enough within a country from year to year. If you only have data for
one year or if the gini score in one year is very close to the gini
score in the next year for the same country, then you can't add both
to your model. 

Regarding your second question: The manual contains a nice sequence
of examples where they gradually go from simple to more complex 

hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen


*   For searches and help try:

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