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: RE: CATPLOT and "ytitle" option


From   "David Radwin" <dradwin@mprinc.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: RE: CATPLOT and "ytitle" option
Date   Wed, 2 Feb 2011 18:25:54 -0800 (PST)

Incidentally, for Lucie and others who may be interested, I learned this
trick from the bottom of p. 193 of Nick Cox's article "Speaking Stata:
Graphing categorical and compositional data", The Stata Journal (2004) 4,
Number 2, pp. 190?215.
http://www.stata-journal.com/article.html?article=gr0004

David

--
David Radwin
Research Associate
MPR Associates, Inc.
2150 Shattuck Ave., Suite 800
Berkeley, CA 94704
Phone: 510-849-4942
Fax: 510-849-0794

www.mprinc.com


> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
> Sent: Wednesday, February 02, 2011 5:26 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: RE: RE: CATPLOT and "ytitle" option
>
> Thanks to David for answering Lucie's question and to both for
> positive comments.
>
> For your information, the default -ytitle()- that -catplot- supplies
> in this instance is "percent". My reasoning behind that was that the y
> axis shows ... percents (not the response variable). An accessible
> example is
>
> . sysuse auto
> . catplot rep78, by(foreign) percent(foreign)
>
> An alternative design is
>
> . catplot rep78 foreign, percent(foreign)
>
> Note that -catplot- makes no use of -title()- but it is available. For
> a presentation, I might use -title()-. For a paper, I would use a
> caption created by my text editor (or word processor should I use
> that).
>
> Nick
>
> On Wed, Feb 2, 2011 at 10:26 PM, Lucie Vlach
> <Lucie.Vlach@albertahealthservices.ca> wrote:
>
> > Thank you very much David!
> > Fantastic... Both suggestions work just great. Exactly what I needed.
> This saved me tons of time.
> > Many thanks to Nick Cox for -catplot-! (I will certainly credit next
> time).
>
> On Behalf Of David Radwin [dradwin@mprinc.com]
>
> > I think you want to specify this
> >
> >    ytitle("`: variable label my_variable2'")
> >
> > or perhaps something like this
> >
> >    ytitle("my_variable2 - `: variable label my_variable2'")
> >
> > which uses the extended macro function (-help extended_fcn-) for
showing
> > the label of a variable.
> >
> > Also, it is good form on Statalist to specify the author of a user-
> written
> > program like -catplot- and where it is available, which in this case
is
> > Nick Cox and SSC. (I made the same mistake once. Perhaps it is because
> > -catplot- is so indispensible to some of us that it seems like an
> official
> > Stata command.)
> >> statalist@hsphsun2.harvard.edu] On Behalf Of Lucie Vlach
>
> >> I need to plot my data, using catplot (works really well), but I
would
> >> like the "ytitle" to display my already existing variable label(s)
(and
> >> possible variable name, but label would be great).
> >> I tried everything, but cannot get this right. Is there a way?
> >> I know I can type in my own titles, but to speed this up, I would
like
> > to
> >> display what I already have associated with each variable for a
title.
> >>
> >> This is what I am using now:
> >>
> >> catplot   my_variable1, percent (my_variable2) by (my_variable2)
> > ysize(3)
> >> ytitle (My Title) blabel (bar, format (%4.1f))
>
> *
> *   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