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: Plot probability function after xtlogit, re - how to interpret constant?

From   Maarten Buis <>
Subject   Re: st: Plot probability function after xtlogit, re - how to interpret constant?
Date   Thu, 23 May 2013 13:52:21 +0200

On Thu, May 23, 2013 at 1:19 PM, Felix Wilke wrote:
> I have some longitudinal models (xtlogit, re) containing interaction effects.
> Now I would like to plot the effect of the interaction effects.
> Therefore I use a function like the following (x2 being a dummy
> variable):
> twoway function
> y0=exp(_b[_cons]+_b[x1]*x)/(1+exp(_b[_cons]+_b[x1]*x)),  range(0 4) ||
> function y1=exp(_b[_cons]+_b[x2]+_b[x1]*x+_b[interaction_x1x2]*x)/(1+exp(_b[_cons]+_b[x2]+_b[x1]*x+_b[interaction_x1x2]*x))

This strategy may work, but it is just too easy to create a typo or
bug this way. It is much safer to use -margins- and the -marginsplot-

*------------------ begin example ------------------
webuse union
xtlogit union age grade i.not_smsa south##c.year
margins, at(age=30 grade=12 not_smsa=1 ///
            south=(0 1) year=(70/88))  ///
marginsplot, x(year)
*------------------- end example -------------------
(For more on examples I sent to the Statalist see: )

> The shape of the function display the effects as expected. My problem,
> however, is the estimated probability. It is unrealistic low - if I
> repeat the same regression as a cross-section analysis I get proper
> probabilities.
> I guess the constant in an xtlogit,re model is to be interpreted
> differently than in a cross sectional logit model. Is this right?

Not really, it is still the expected log odds of success when all
covariates equal 0. This now includes the group level error term, but
the value 0 there refers to an average group, so that is not the
source of your problem.

> And how do I interpret the estimated probabilities in a xtlogit, re model?

Just as you would any other probability.

Hope this helps,

Maarten L. Buis
Reichpietschufer 50
10785 Berlin
*   For searches and help try:

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