Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: gllamm and marginal effects

From   David Jaeger <>
Subject   Re: st: gllamm and marginal effects
Date   Mon, 6 Mar 2006 14:55:55 +0100

Ok, here's the answer to my own question. One can use gllamm to estimate the random effects probit
(and random effects tobit) models (among many others, of course), and then send the parameter estimates
through xtprobit or xttobit to get the marginal effects that one can calculate after estimation with those commands.

For random effects probit, the following should work:

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)
mfx compute, predict(pu0)

And for random effects Tobit (where the dependent variable is left- censored only -- trivial to modify for
right and left censoring):

gen var=cond(movedist==0,2,1)

gllamm ycens x1 x2 x3 , i(id) fam(gauss binom) link(ident sprobit) lv (var) fv(var) adapt
matrix aa=e(b)
local n=colsof(aa)
matrix a=aa
matrix a[1,`n'-1]=aa[1,`n']
matrix a[1,`n']=exp(aa[1,`n'-1])
xttobit ycens x1 x2 x3 , re i(id) ll(0) intpoints(30) from(a,copy) iterate(0)
mfx compute, predict(pr0(0, .))
mfx compute, predict(e0(0,.))
mfx compute, predict(ys(0,.))

Hope someone finds this useful!


On 3 Mar 2006, at 15:00, David Jaeger wrote:

I'm using gllamm to estimate a random effects probit model. Anybody know if there's
an easy way to get marginal effects with gllamm, equivalent to using mfx compute, predict(pu0) after
using xtprobit?

Thanks in advance!

Associate Professor of Economics and Public Policy
College of William and Mary
Williamsburg, VA 23187-8795 USA
ph: +1 757 221 2375

* For searches and help try:
*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index