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: labels in -hbar- with over() and sort() specified


From   Scott Merryman <scott.merryman@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: labels in -hbar- with over() and sort() specified
Date   Wed, 11 Apr 2012 09:17:05 -0500

The same thing happens in version 12.1

Perhaps something like this:


sysuse auto, clear
ta  headroom, g(z)
drop z6-z8

collapse z*, by(fore)
reshape long z, i(fore)
graph hbar (asis) z,  over(_j) over(_j, sort(z) gap(0)) ///
 over(fore) legend(off) bargap(0)


Scott

On Wed, Apr 11, 2012 at 6:33 AM, Joshua Dewbre <jdewbre@gmail.com> wrote:
> Dear Statalist,
>
> I'm having trouble with labeling in -hbar- when using both (over) and
> (sort) options. Consider:
>
> **
> sysuse auto, clear
> ta  headroom, g(z)
> drop z6-z8
> gr hbar (mean) z*  , over(for)  ///
> yvaroptions(relabel(1 "m_z1" 2 "m_z2" 3 "m_z3" 4 "m_z4" 5 "m_z5")) ///
> blabel( name, size(small)) legend(off)
> **
>
> Good. But now I want things sorted by magnitude:
>
> **
> gr hbar (mean) z*  , over(for)  ///
> yvaroptions(relabel(1 "m_z1" 2 "m_z2" 3 "m_z3" 4 "m_z4" 5 "m_z5") ///
> sort(1)) blabel( name, size(small))  legend(off)
> **
>
> Now the labels don't correspond to the bars (in Domestic).
>
> Any suggestions? I'm on Stata 11.2.
>
> Thanks,
>
> Josh
>

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