# Re: st: RE: graphing predicted probabilities after xtmelogit

 From Maarten buis To statalist@hsphsun2.harvard.edu Subject Re: st: RE: graphing predicted probabilities after xtmelogit Date Mon, 17 Mar 2008 08:52:13 +0000 (GMT)

```--- Daniel Rubenson <rubenson@politics.ryerson.ca> wrote:
> I'm not sure your suggestion does what I want. Don't I have to make
> new predictions for the different values of my variable, minority
> (instead of simply plotting minority==0 and minority==1)?

Did you try the example as it says in
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html#work ? Do that, and
you will see that it does what you want. To understand why read the

> And let's say I also want 95%CI for the plots?

*-------------------- begin example --------------------
xtmelogit c_use urban age child* || district:

adjust child1=0 child2=0 child3=0, se gen(xb se)
gen pr = invlogit(xb)
gen lb = invlogit(xb - invnormal(.975)*se)
gen ub = invlogit(xb + invnormal(.975)*se)
sort urban age
twoway rarea lb ub age if urban == 0 || ///
rarea lb ub age if urban == 1 || ///
line pr age if urban == 0     || ///
line pr age if urban == 1,       ///
legend(order(3 "rural"           ///
4 "urban" ))
*------------------- end example ------------------------
(For more on how to use examples I sent to the Statalist, see
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------

___________________________________________________________
Rise to the challenge for Sport Relief with Yahoo! For Good

http://uk.promotions.yahoo.com/forgood/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```