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

# Re: st: Plot probability function after xtlogit, re - how to interpret constant?

 From Maarten Buis To statalist@hsphsun2.harvard.edu 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-
command.

*------------------ begin example ------------------
webuse union
xtlogit union age grade i.not_smsa south##c.year
south=(0 1) year=(70/88))  ///
predict(pu0)
marginsplot, x(year)
*------------------- end example -------------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )

> 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

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

Just as you would any other probability.

Hope this helps,
Maarten

---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------
*
*   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/
```