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 Felix Wilke To statalist@hsphsun2.harvard.edu Subject Re: st: Plot probability function after xtlogit, re - how to interpret constant? Date Thu, 23 May 2013 15:27:28 +0200

```Dear Maarten,
thanks for your suggestion to use margins. I will certainly have a
look at my predictions with marginsplot as well.

But as you already stated, that does not really solve my problem.

The following example shows what I mean:

***
webuse union
xtlogit not_smsa age, re
twoway function befristet= exp(_b[_cons]+_b[age]*x)/(1+exp(_b[_cons]+_b[age]*x))
logit not_smsa age
twoway function y= exp(_b[_cons]+_b[age]*x)/(1+exp(_b[_cons]+_b[age]*x))

**

the relative frequency of not_smsa is about 0.28
the logit estimation suggests probabilities around 0.2 depending on age.
the xtlogit, re estimation however suggests probabilities around 0.005
depending on age.
*centering age does not change these results substantially*

So my question remains how to interpret these probabilities.

Felix

On 23 May 2013 13:52, Maarten Buis <maartenlbuis@gmail.com> wrote:
> 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
> margins, at(age=30 grade=12 not_smsa=1 ///
>             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/
*
*   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/
```