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: does -margins- work after -menbreg- or -mepoisson- in Stata 13?


From   Joerg Luedicke <[email protected]>
To   [email protected]
Subject   Re: st: does -margins- work after -menbreg- or -mepoisson- in Stata 13?
Date   Mon, 12 Aug 2013 13:55:22 -0400

Marginal effects in generalized mixed effects models (i.e., models
with non-identity link functions) can be tricky because the random
effects are symmetrically distributed around zero only on the scale of
the linear predictor but not on the raw-scale. So in order to do
marginal raw scale predictions that include the random effects you
somehow need to average over those random effects, for which you need
to pick some approach  (I would think this is the main reason behind
the mentioned error message). For example, one possibility would be to
simulate from posterior distributions. If I remember correctly, such
issues are discussed in:

Skrondal, A & S Rabe-Hesketh (2009): Prediction in multilevel
generalized linear models. Journal of the Royal Statistical Society A,
172(3): 659-687.

or here with respect to count data applications:

http://www.ncbi.nlm.nih.gov/pubmed/22905895

Alternatively, you could predict from the estimated fixed effects only
by using -margins-' -predict(fixedonly)- option, which may be
appropriate in some situations, or use a marginal model like GEE.

Joerg

On Mon, Aug 12, 2013 at 9:57 AM, Ariel Linden, DrPH
<[email protected]> wrote:
> This won't make you feel any better, but I receive the same error when using
> -meglm-
>
> webuse pig
> meglm weight i.week || id:
> margins
>
> default prediction is a function of possibly stochastic quantities other
> than e(b)
> r(498);
>
>
> I spent an entire day trying to track down the post-estimation commands for
> margins after meglm, to no avail.
>
> Substituting -mixed- for -meglm- works fine
>
> webuse pig
> mixed weight i.week || id:
> margins
>
> Ariel
>
> Date: Sun, 11 Aug 2013 19:28:39 -0500
> From: Steve <[email protected]>
> Subject: st: does -margins- work after -menbreg- or -mepoisson- in Stata 13?
>
> I'm trying to use -margins- after -menbreg-.
>
> No matter how I set up the -margins- command, I receive the following
> error message:
>
> default prediction is a function of possibly stochastic quantities other
> than
> e(b)
> r(498);
>
> Here's just one example of the syntax I've used:
>       margins x1, at(x2=(-1(.1)3))
> where
>      x1 = dichotomous variable
> and
>      x2 =  continuous variable
>
> Both variables are in the -menbreg- model.
>
> I have the same problem after mepoisson.
>
> I know that -margins- works after -mixed- in Stata 12.
>
> Am I neglecting something or will -margins- not work after -menbreg- and
> - -mepoisson- in Stata 13?  Are there other new mixed commands in Stata 13
> after which -margins- will not work?
>
> Steve Rothenberg
> Instituto Nacional de Salud Pública
> Cuernavaca, Morelos, México
>
>
>
> *
> *   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/

*
*   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