Including totals in bar graph in Stata

Below is a worked example of including the totals into a bar graph:

I used the auto.dta dataset as an example. The commands I used in a do-file are as below:

sysuse auto, clear
save auto1 , replace
replace for=3
label define  origin 3 Total, add
append using auto1
graph bar (mean) price , over(rep78, ) over(for) showyvars ///
ascategory asyvar legend(off)
exit




0 views

© 2020 by Survey Design and Analysis Services. 

  • LinkedIn
  • Facebook
  • Twitter
  • YouTube