
As the syntax and graph example show, multidot defaults to a dot chart but can be recast to a horizontal bar chart. BAR CHART FOR SINGLE DISCRETE VARIABLE: command histogram with option discrete. the date): graph twoway line close date line close high date Generate a new variable age without any data drop var Eliminates variables or observations anova. Multidot from SSC is an attempt to address all these problems for showing two or more outcomes on different scales for a set of categories. Stata for Graphs version 16 of 62 Design Data Collection Data Management Data Summarization Statistical Analysis Reporting Sample session, continued: green-comments black-commands blue-results.
#Stata graph bar install
(Using a legend instead often works badly too.) In the case of countries there is another work-around of using standard two or three-letter abbreviations, which are fairly widely understood.įor these and other reasons, horizontal bar charts are often preferable. shp2dta can be installed in Stata with this command: ssc install shp2dta Stata is great, but its true that R makes prettier graphs, especially when you make. The names you want to show as axis labels are often long enough to cause a mess, and although there are work-arounds for this (vertical or slanted labelling abbreviation small fonts) none is attractive. graph bar makes this easier by allowing sorting on any variable otherwise it requires some work to get to a better solution.ī. The default ordering of names alphabetically is rarely helpful or desirable. In practice, (vertical) bar charts for data like yours are often problematic:Ī. Graph bar supports a string variable for the categorical axis, but you'd have to work out yourself some way of showing very different quantities on the y axis. But then you would still need to work at the graph to ensure that the bars for larger quantities don't occlude those for smaller quantities, for example by offsetting bars.

In the absence of a data example, as requested, a silly toy example must serve.Īs the error message is already telling you, twoway bar requires a numeric variable for the x axis, so you would need to produce one using say encode.
