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: Plot of horizontal bars in descending order of the percentages of categories of a string variable


From   Nick Cox <njcoxstata@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Plot of horizontal bars in descending order of the percentages of categories of a string variable
Date   Sun, 1 Dec 2013 10:17:50 +0000

By the way, -tabhbar- (SSC) is documented as obsolete given -catplot-
(SSC) in -njc_stuff- (SSC).

Why then is it still available? SSC is an archive, with all that
implies: it contains a lot of old stuff, just in case it is
interesting or useful. Unlike an archive of books, papers and so
forth, storage space is not an issue.
Nick
njcoxstata@gmail.com


On 1 December 2013 02:01, Nick Cox <njcoxstata@gmail.com> wrote:
> -tabhbar- (SSC) was written for Stata 6 in 1999!  I haven't used it
> myself, I think, since Stata 8.
>
> Try -catplot- (SSC).
>
> Some technique:
>
> sysuse auto
>
> set scheme s1color
>
> catplot rep78, percent var1opts(sort(1) descending)  ///
> bar(1, bfcolor(blue*0.1)) blabel(bar, pos(inside) format(%2.1f))
>
> Nick
> njcoxstata@gmail.com
>
>
> On 1 December 2013 00:11, jose maria pacheco de souza <jmpsouza@usp.br> wrote:
>
>> I have a string variable with 10 categories (var1 with a b c d e f g h i
>> j, say) and want a plot of horizontal bars of their percentages
>> of occurrence, ordered from greatest to lowest.
>> I used the  comand *tabhbar var1, rfsort rowpc xla(0(5)35)
>> t1title(percentage) flipt* written by Nick Cox but would like to enhance the
>> graph putting the percentagens inside the bars and filling the bars with
>> light color.
>> My Stata versions are 10 and 12.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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