I'm creating bar graphs with similar code:
graph bar var1 var2 var3 var4, ///
over(race, relabel (1 "race1" 2 "race2" 3 "race3" 4 "race4" 5 "race5")) ///
stack ///
graphregion(color(white)) ///
title("Average Number of Things", color(black)) ///
subtitle("Subgroup", color(black)) ///
ytitle("# of Things") ///
ylabel(0(.5)2,nogrid) ///
legend(label (1 "Type 1") ///
label (2 "Type 2") ///
label (3 "Type 3") ///
label (4 "Type 4")) ///
bar(1, bcolor(navy)) ///
bar(2, bcolor(ebblue)) ///
bar(3, bcolor(eltblue)) ///
bar(4, bcolor(ebg)) ///
blabel(total, format(%4.1f))
var1+var2+var3+var4 = total of interest
I'd like each bar to be labeled with the total of var1+var2+var3+var4 but not any of the lesser cumulative totals. Is there any way to do this using graphing options that I can write into a .do file? I can delete all the lesser cumulative totals produced with the above code using the graphing editor, but I'd really like to be able to automate that.
Thank you!
Related Posts with bar graph / blabel()
What is a GROUP variable in difference in differences analysis?Query: What is a GROUP variable in difference in differences analysis? Study: Newspaper articles fr…
Interpreting coefficients (percentage points vs percentage)I was reading a paper that ran a difference-in-differences regression and the coefficient value was …
Old bugDear All, I hope someone following Stata for many years can help me with remembering: there used to…
Interpreting coefficients (percentage vs percentage points)I was reading a paper that ran a difference-in-differences regression and the coefficient value was …
How can I get several variables' mean values at the smaeI want to create a vector containing several variables' mean values. But the summarize command only …
Subscribe to:
Post Comments (Atom)
0 Response to bar graph / blabel()
Post a Comment