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: 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–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index