.- help for ^vbar^ (STB-36: gr24) .- Vertical bar charts ------------------- ^vbar^ varlist [weight] [^if^ exp] [^in^ range] [^,^ ^so^rt^(^sortvar^) rso^rt^(^sortvar^) laby(^labelvar^) by(^byvar^)^ ^ca^tegory ^sep^bars ^perc^ ^prop^ ^pbyg^ ^pbyv^ bar_options ] Description ----------- ^vbar^ produces bar charts for varlist. It is, by and large, equivalent to ^graph, bar^, but with some extra options, and so of interest only for those extra options. Options ------- ^sort(^sortvar^)^ means that bars are to be plotted in ascending order of sortvar, highest values on right. If weights are used and sortvar is numeric, then the order is calculated using the weights. ^sort^ may not be combined with ^rsort^ or ^by^. ^rsort(^sortvar^)^ means that bars are to be plotted in descending order of sortvar, highest values on left. If weights are used and sortvar is numeric, then the order is calculated using the weights. ^rsort^ may not be combined with ^sort^ or ^by^. ^laby(^labelvar^)^ means that bars are to be plotted with labels from labelvar, normally but not necessarily a string variable containing text. ^laby^ may not be combined with ^by^. ^by(^byvar^)^ means what it does with ^graph, bar^: bars are plotted in groups according to the values of byvar. Note that ^by^ may not be combined with ^sort^ or ^rsort^ or ^laby^. ^category^ applies when varlist contains a single categorical variable and it is desired to show the count or frequency in each category. If the number of categories is 6 or fewer, a set of temporary indicator variables will be generated, and the bars will touch and have (by default) different colors and shadings. If the number of categories is 7 or more, the categories will be plotted as separate bars for a single variable, with the same color and shading, so long as ^by^ has not been invoked. However, if separate bars are preferred when the number of categories is 6 or fewer, use the ^sepbars^ option in addition. ^sepbars^ is explained just above and is restricted to overriding a default behaviour with the ^category^ option. ^perc^ means that results are to be reported as percents. The default is percents of the grand total of all the variables in the varlist. See also ^pbyg^ and ^pbyv^. ^perc^ and ^prop^ are mutually exclusive. ^prop^ means that results are to be reported as proportions or fractions between 0 and 1. The default is proportions of the grand total of all the variables in the varlist. See also ^pbyg^ and ^pbyv^. ^prop^ and ^perc^ are mutually exclusive. ^pbyg^ means that percents or proportions (one must be specified) are of the total of all the values in each group, defined by one value of the ^by( )^ variable. ^pbyg^ and ^pbyv^ are mutually exclusive. ^pbyv^ means that percents or proportions (one must be specified) are of the total of all the values for each variable in the varlist. ^pbyv^ and ^pbyg^ are mutually exclusive. bar_options are other options allowed with ^graph, bar^. See [R] graph or on-line help for @graph@, including details on ^means^, ^stack^, ^shading()^ and ^alt^. Examples -------- . ^vbar rep78, ca^ . ^vbar div if reg==1, laby(state) rsort(div) yla^ . ^vbar shop, by(car) ca perc pbyg gap(5) yla l2("percent of total")^ Note ---- The name ^vbar^ is chosen partly in deference to Stata Corporation's stated wish that users avoid proper English words for names of ado files, and partly as a signal that Stata needs commands to produce horizontal bar charts. Author ------ Nicholas J. Cox University of Durham, U.K. n.j.cox@@durham.ac.uk Also see -------- STB: STB-36 gr24 Manual: [R] graph On-line: help for @graph@, @hist@