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, statalist.org 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 <justinswhite@hotmail.com>
To   statalist@hsphsun2.harvard.edu
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
(http://statalist.blogspot.com/2006/03/re-st-gllamm-and-marginal-effects.html).  

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
commands.  

Justin 


--
View this message in context: http://statalist.1588530.n2.nabble.com/gllamm-gllapred-and-marginal-effects-tp5815877p6445221.html
Sent from the Statalist mailing list archive at Nabble.com.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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