Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: RE: xtmelogit

From   "Szabo S.M." <>
To   "" <>
Subject   st: RE: xtmelogit
Date   Wed, 14 Nov 2012 13:50:09 +0000

Thank you for getting back. This is a large merged household level dataset with over 650,000 observations over 38 countries. There two levels only - household level and contextual (country) level. 

Thank you for the valuable feedback. I think I will give Stata another go...


-----Original Message-----
From: [] On Behalf Of
Sent: 14 November 2012 09:51
Subject: st: xtmelogit


Date: Tue, 13 Nov 2012 19:44:55 -0500
From: "JVerkuilen (Gmail)" <>
Subject: Re: st: xtmelogit

On Tue, Nov 13, 2012 at 4:22 PM, Szabo S.M. <>
> Dear STATA Listers,
> I wanted to inquire whether anyone else had a problem using xtmelogit
command. I am trying to fit a couple of multilevel logistic models and it takes a (very) long time to obtain output (including interactions, random effects, unstructured covariance and odds ratio options).
> This has lead me to a frustration and considering switching to MLWin,
although I have traditionally used STATA.

Sounds like you're trying to fit a very complex model, which will take a long time due to the fact that adaptive quadrature is being used by
- -xtmelogit-. You may want to switch to the Laplace approximation to see if that speeds things up and then use adaptive quadrature only on the final model.


I second J's comments. Getting good starting values via Laplace approximation is likely a good way to go. I would add that estimation times will also depend on sample size and the nature of the multi-level structure (about which you don't give us details).

Advice commonly given on this list is to start with a less complex model and then make it more complicated. Be aware that models of the sort that you wish to estimate are intrinsically tricky to fit.

MLwiN ( is very useful software in many respects. (It's also free to UK-based academics; not too costly for others.) In particular, it is relatively fast -- after all, it's a specialised tool for this sort of model whereas Stata is more general software. Be aware though that the estimation algorithms that MLwiN uses to fit -xtmelogit- type models differ from those used by Stata, and so estimates may differ especially for random effects parameters. Stata uses adaptive quadrature; MLwiN offers marginal and penalised quasi-likelihood options (and MCMC). This can matter. In some Monte-Carlo work currently in progress, I find that for a 2-level set-up (large N of individuals nested within C countries), -xtmelogit- does a distinctly better job at fitting the random effects parameters than does MLwiN with method PQL2 (smaller bias, better coverage) particularly in the 'small C' case. Both do well regarding the 'fixed' parameters. MLwiN e!
 stimation time is a fraction of Stata's, however.

If you do consider MLwiN, then I strongly recommend using -runmlwin- (on
SSC) to call MLwiN from within Stata. -runmlwin- is a wonderful front-end, and produces post-estimation results in a way that Stata users have come to expect. (MLwiN isn't that good on those sorts of things, in my opinion.)

You might consider using MLwiN to get starting values and then use them in -xtmelogit- in Stata. (NB "Stata", not "STATA")

Stephen P. Jenkins  <> Professor of Economic and Social Policy Department of Social Policy London School of Economics and Political Science Houghton Street, London WC2A 2AE, U.K.
Tel. +44 (0)20 7955 6527
Changing Fortunes: Income Mobility and Poverty Dynamics in Britain, OUP 2011,
Survival Analysis using Stata:
Downloadable papers and software:

Please access the attached hyperlink for an important electronic communications disclaimer:

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index