Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
Maarten Buis <maartenlbuis@gmail.com> |

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

**Follow-Ups**:**Re: st: Plot probability function after xtlogit, re - how to interpret constant?***From:*Felix Wilke <felixw83@gmail.com>

**References**:**st: Plot probability function after xtlogit, re - how to interpret constant?***From:*Felix Wilke <felixw83@gmail.com>

- Prev by Date:
**Re: st: RE: Conserving variables and value labels while reshaping wide to long** - Next by Date:
**Re: st: RE: Conserving variables and value labels while reshaping wide to long** - Previous by thread:
**st: Plot probability function after xtlogit, re - how to interpret constant?** - Next by thread:
**Re: st: Plot probability function after xtlogit, re - how to interpret constant?** - Index(es):