Bookmark and Share

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


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

RE: st: RE: marginsplot is acting differently


From   "Philip Ryan" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: marginsplot is acting differently
Date   Sat, 31 Dec 2011 21:28:18 +1030

<<>>

Richard,

Further to our discussion on the behaviour of -marginsplot-, try this
(apologies in advance if line endings are zapped):

webuse nhanes2f, clear

logit diabetes i.black i.female age, nolog 

margins, dydx(black female) at(age=(20 30 40 50 60 70)) vsquish 
marginsplot, noci

margins r.black  r.female, at(age= (20 30 40 50 60 70)) vsquish
marginsplot, noci


The first -margins/marginsplot- sequence is as you tried, and yields the
unwanted base level lines.  The second is the alternative discussed on pages
1113-1114 of the manual and _should_ give "an identical graph" (para 1 page
1114), but this syntax yields a graph that omits the unwanted lines.  

I don't know whether the first syntax's production of the base level lines
is a feature or a bug, but it doesn't appear to be consistent with (my
reading of) the manual.

Phil


Philip Ryan
Professor and Director
Data Management & Analysis Centre
School of Population Health & Clinical Practice
University of Adelaide

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Richard Williams
Sent: Saturday, 31 December 2011 12:28 PM
To: [email protected]; [email protected]
Subject: Re: st: RE: marginsplot is acting differently

At 08:43 PM 12/30/2011, Philip Ryan wrote:
>Richard,
>
>I this what you are after?  (it's a cover-up kludge, although it avoids 
>the Graph Editor; it would be nice if marginsplot at least had an 
>option to suppress the output for the reference categories.)
>
>webuse nhanes2f, clear
>logit diabetes i.black i.female age, nolog margins, dydx(black female) 
>at(age=(20 30 40 50 60 70)) vsquish marginsplot, noci 
>plot1opts(connect(i) msymb(i)) plot3opts(connect(i)
>msymb(i)) ///
>legend(order(2 "effect on Pr(diabetes) for blacks"  4 "effect on
>Pr(diabetes) for females")  rows(2))
>
>
>best wishes to all for 2012.
>
>Phil

Thanks Phil. That does seem to work, although it seems like it shouldn't
have to be that hard. I still think there is a bug, but if not or if it
never gets fixed your solution will be handy. Best wishes to you and
everyone else too.


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  [email protected]
WWW:    http://www.nd.edu/~rwilliam

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/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/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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