Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: margin and gsem


From   [email protected] (Jeff Pitblado, StataCorp LP)
To   [email protected]
Subject   Re: st: margin and gsem
Date   Mon, 26 Aug 2013 16:31:58 -0500

Klaus Pforr <[email protected]> is using -margins- after -gsem-, but
-margins- is not returning estimable results when it should:

> I used some of the examples and tried to estimate margins of responses
> and marginal effects. So far I could not manage to get estimate from
> margin with any of the gsem examples.
> 
> I'm especially interested in multilevel mlogit models. I am fully
> aware of the problems with the random part with this problem, but the
> predict(fixedonly) option did not help in any way.
> 
> Just to give an idea, what I am talking about, I put in some examples:
> 
> * This is an mlogit. The problem does not change, when you run a logit
> on only two outcomes
> use http://www.stata-press.com/data/r13/gsem_lineup
> gsem (i.chosen <- i.location i.suswhite i.witmale i.violent
> M1[suspect]@1), mlogit
> margin, predict(mu fixedonly)
> margin, dydx(*) predict(mu fixedonly)
> 
> * This is a linear model. The problem does not change, when you break
> the continous variable in
> * groups and run logit or mlogit
> use "http://www.stata-press.com/data/r13/gsem_fifeschool";, clear
> gsem (attain <- vrq i.sex M1[pid] M2[sid]),
> margin, predict(mu fixedonly)
> margin, dydx(*) predict(mu fixedonly)
> 
> Has anyone worked with an gsem example, in which margins worked?

Klaus has found a bug in how -margins- handles -gsem- results containing
multilevel latent variables.

-margins- is mistakenly treating multilevel latent variables (e.g.
M1[suspect]) as intercepts, which is causing it to fail the estimable
functions test.

The fix for this should be available in the next update to Stata 13.

--Jeff
[email protected]
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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