Bookmark and Share

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

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

Re: st: Omnibus effects following xtmelogit with margins

From   Philip Ender <>
Subject   Re: st: Omnibus effects following xtmelogit with margins
Date   Fri, 24 Sep 2010 12:06:16 -0700

"Ploutz-Snyder, Robert (JSC-SK)[USRA]" wrote
... I also ran into a snag using -margins- as I usually do after an
-xtmixed- model to obtain omnibus main effects for an ordinal factor
But my use of -margins- to get the omnibus main effect for time (as I
would with xtmixed) failed:

. margins time, asbalanced atmeans
default prediction is a function of possibly stochastic quantities
other than e(b)

I've been following your discussion with Michael Mitchell about the
design of your analysis.  I would like to pick up on your second
question concerning using -margins-, for which I have two comments.

1)  The default predictor for -xtmelogit- is mu which has uses both
fixed and random effects.  If you are interested in having the
predictive margins scaled as a linear predictor, you can use

.   margins time, asbalanced atmeans predict(xb)

If you want to have your predictive margins scaled as a probabilities,
then -margins- can (will) only use the fixed effects of the model,
like this.
.  margins time, asbalanced atmeans predict(mu fixedonly)

2)  In any case, neither of the above is a "true" main effect because
the factor variables use dummy coding.  You can use the -anovalator-
to get main effects (findit anovalator).

.  anovalator time, predict(xb)   /* or */
.  anovalator time, predict(mu fixedonly)

I hope this is not too confusing.

Phil Ender
UCLA Statistical Consulting Group
*   For searches and help try:

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