Bookmark and Share

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]

Re: st: How to start a bar graph with a minimum other than 0


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: How to start a bar graph with a minimum other than 0
Date   Wed, 31 Aug 2011 15:55:12 +0100

I am confused. I understand you to want to plot means and to exclude
0. You should be able to do that.

The means all lie well within (50, 100) so there should be no problem
with labels.

By the way, -graph dot- is in my view a better recipe for plotting
means. You know about advice about starting bars at 0 and prefer to
override it, but any audience is unlikely all to have the same views.

Nick

On Wed, Aug 31, 2011 at 3:51 PM, Andrew Hsiao <ahsiao@newvisions.org> wrote:
> They range from 0 to 100, as follows:
>
>   stats |  atdpct~p  atdpct~t  atdpct~v  atdpct~c  atdpc~an  atdpct~b  atdpc~ar  atdpc~pr  atdpct~y  atdpc~un
> ---------+----------------------------------------------------------------------------------------------------
>    mean |  83.61696  84.98656   84.3946  82.84795  79.61899  83.41614  85.06694  84.06865   83.3088  75.68124
>      sd |  28.94568  27.03967  26.93099  27.17241   27.2614  25.97958  24.33739  25.44562  25.65833  28.19591
>     min |         0         0         0         0         0         0         0         0         0         0
>     max |       100       100       100       100       100       100       100       100       100       100
>
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
> Sent: Wednesday, August 31, 2011 10:43 AM
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: How to start a bar graph with a minimum other than 0
>
> So, it sounds as though you should not start at 50.
>
> What is the range of means to be plotted on the y axis?
>
> On Wed, Aug 31, 2011 at 3:35 PM, Andrew Hsiao <ahsiao@newvisions.org> wrote:
>> Unfortunately if I use ylabel(50(10)100), it only labels the top part of the y axis.
>>
>> -----Original Message-----
>> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
>> Sent: Wednesday, August 31, 2011 10:25 AM
>> To: statalist@hsphsun2.harvard.edu
>> Subject: Re: st: How to start a bar graph with a minimum other than 0
>>
>> My guess: Your -ylabel()- option insists on a label at 0. Stata is
>> attempting to follow your instructions and that trumps -exclude0-.
>>
>> Nick
>>
>> On Wed, Aug 31, 2011 at 3:24 PM, Andrew Hsiao <ahsiao@newvisions.org> wrote:
>>> Hi!
>>>
>>> I was trying to create a bar graph with a set of group means. The differences between the groups are not big numerically but I'd like to highlight the differences. I want to  plot the bars at a value other than 0 (not meant to mislead but to make the point of where they differ).
>>>
>>> I thought yscale(range(50 100)) would do the trick but it doesn't. Even including exclude0 has no effect. Is Stata trying to keep me honest? Or am I missing something?
>>>
>>> Thanks for anyone who would shed the light.
>>>
>>> Andrew
>>>
>>> ============================================================================= the syntax I used:
>>>
>>> graph bar (mean) atdpct1011sep (mean) atdpct1011oct (mean) atdpct1011nov (mean) atdpct1011dec (mean) atdpct1011jan ///
>>>        (mean) atdpct1011feb (mean) atdpct1011mar (mean) atdpct1011apr (mean) atdpct1011may (mean) atdpct1011jun ///
>>>        if bucket != "Transfer", title(2010-2011 Monthly Average Attendance) ytitle(Average Monthly Attendance) note(* transfer schools not included) ///
>>>        bar(1, fcolor(ltkhaki) lcolor(gs10)) bar(2, fcolor(gs15) lcolor(gs10)) bar(3, fcolor(gs15) lcolor(gs10)) bar(4, fcolor(gs15) lcolor(gs10)) ///
>>>        bar(5, fcolor(gs15) lcolor(gs10)) bar(6, fcolor(gs15) lcolor(gs10)) bar(7, fcolor(gs15) lcolor(gs10)) bar(8, fcolor(gs15) lcolor(gs10)) ///
>>>        bar(9, fcolor(gs15) lcolor(gs10)) bar(10, fcolor(gs15) lcolor(gs10)) ///
>>>        bargap(10) yscale(range(50 100)) ylabel(0(10)100) legend(off) showyvars ///
>>>        yvaroptions(relabel(1"Sep" 2 "Oct" 3 "Nov" 4 "Dec" 5 "Jan" 6 "Feb" 7 "Mar" 8 "Apr" 9 "May" 10 "Jun")label(angle(45))) ///
>>>        by(, title(2010-2011 Monthly Attendance) note(* Transfer schools not included; based on monthly ATS RIAS reports)) exclude0
>>>

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index