Stata如何生成带有标准误的水平条形图?

生成上图的Stata命令如下:


* Figure: Horizontal bar plot with grouping of variables, standard error bars, and cross-group comparisons

* Replication file for:
* Satyanarayana S, Kwan A, Daniels B, Subbaraman R, McDowell A, Bergkvist S, Das RK, Das V, Das J, Pai M. 
* Use of standardised patients to assess antibiotic dispensing for tuberculosis by pharmacies in urban India: 
* A cross-sectional study. 
* The Lancet Infectious Diseases. 2016 Nov 30;16(11):1261-8.
	

    global pct `" 0 "0%" .25 "25%" .5 "50%" .75 "75%" 1 "100%" "'

    qui do "http://ds.epiman.cn/uploads/2022/06/betterbar.ado"

    use "http://ds.epiman.cn/uploads/2022/06/bar-better-ci.dta", clear

    betterbar ///
        (dr_3 correct_treatment)  ///
        (med_b2_any_antibiotic med_b2_any_steroid med_b2_any_antister med_l_any_2 med_b2_any_schedule_h med_b2_any_schedule_h1 med_b2_any_schedule_x med_l_any_1)   ///
        , ///
        over(city) xlab($pct) se bin ///
        legend(pos(5) ring(0) c(1) symxsize(small) symysize(small)) ///
        ysize(7) n barlab(upper)
		
* Have a lovely day!
* Source: https://worldbank.github.io/stata-visual-library/bar-better-ci.html