I am attempting to display the change in insurance coverage "CHANGE" for each state (n=51 incl. DC). For each state I also have a variable that indicates the state's policy status (none, full, early). I would like a bar graph that shows a bar for each state (preferably sorted by magnitude of change) with the state abbreviation above the bar and the bar colored to indicate its expansion status.
The code below colors the bars differently (although I am afraid it is not coloring the bars correctly for each state since I sort the bars) but does not result in the state's abbreviation being shown above the relevant bar. If I remove the code beginning at 'asyvar', the abbreviation is displayed above the bar. If I keep that code but change to blabel(bar), the value is displayed above the bar.
graph bar CHANGE, over(STATE, gap(30) sort(1)) blabel(group, position(outside) size(tiny)) legend(off) ///
asyvars ///
bar(1, color(orange)) ///
bar(2, color(green)) ///
bar(3, color(blue)) ///
bar(4, color(blue)) ///
bar(5, color(yellow)) ///
...
bar(51, color(orange))
Is it possible to create a single bar graph? I have contemplated creating separate graphs for each policy status. Thanks!
The code below colors the bars differently (although I am afraid it is not coloring the bars correctly for each state since I sort the bars) but does not result in the state's abbreviation being shown above the relevant bar. If I remove the code beginning at 'asyvar', the abbreviation is displayed above the bar. If I keep that code but change to blabel(bar), the value is displayed above the bar.
graph bar CHANGE, over(STATE, gap(30) sort(1)) blabel(group, position(outside) size(tiny)) legend(off) ///
asyvars ///
bar(1, color(orange)) ///
bar(2, color(green)) ///
bar(3, color(blue)) ///
bar(4, color(blue)) ///
bar(5, color(yellow)) ///
...
bar(51, color(orange))
Is it possible to create a single bar graph? I have contemplated creating separate graphs for each policy status. Thanks!
Comment