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: gllamm, gllapred, and marginal effects

From   jsw <>
Subject   st: Re: gllamm, gllapred, and marginal effects
Date   Mon, 6 Jun 2011 06:54:19 -0700 (PDT)

One circuitous option is to run the -gllamm- command through -xtlogit-, and
then use run -margins- (or mfx).  Credit goes to David Jaeger who posted the
solution on the Statalist in 2006

For a random effects probit model, here's a slightly modified version of
Jaeger's code: 

gllamm y x1 x2 x3 , i(id) link(probit) fam(binom) adapt 
matrix a=e(b) 
* local n=colsof(a)
* matrix a[1,`n']=ln(a[1,`n']) 
xtprobit y x1 x2 x3 , re i(id) from(a,copy) intpoints(30) iterate(0) 
margins, dydx(*) predict(pu0)

I commented out two lines, because the code wouldn't run with them and I
seemed to be getting the correct answers without them.  If they are
essential, I would love to know.  

This approach can be modified for -xtlogit- and many other estimation


View this message in context:
Sent from the Statalist mailing list archive at
*   For searches and help try:

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