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()
Stata- margins and rifreg commandHi, We have a problem with margins after rifreg command: it works without writting xi in front of ri…
Rosenbaum BoundsHi, I have conducted propensity score matching using the WHO-5 Mental Health Index as my outcome va…
Assigning value "1" to a dummy variable when another variable reaches its max, for each individual across choice alternativesI have a dataset of about 3800 observations. This dataset is in long form: I have about 760 individu…
Generating a New Variable based on Conditional IF StatementsHello STATA Experts: I am trying to create a new variable based on the existence of certain conditio…
Does data on a time series need to be balanced like panel data?Does data on a time series need to be balanced like panel data? …
Subscribe to:
Post Comments (Atom)
0 Response to bar graph / blabel()
Post a Comment