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


From   Scott Merryman <[email protected]>
To   [email protected]
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 <[email protected]> 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index