Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bar graphs with min/max/mean


    Hi all,

    Is there any way to do a bar graph like this in Stata? Also, to add sample sizes (n=20, or whatever) to the bars?
    Thanks in advance!!

  • #2
    Code:
    twoway bar ... || rbar ... || rspike ....

    Comment


    • #3
      Here' some technique. I haven't tried to reproduce your graph exactly.

      Code:
      sysuse auto, clear
      
      * ssc install rangestat 
      rangestat (min) min=price (mean) mean=price (max) max=price, int(rep78 0 0)
      
      gen rep78_2 = rep78 + 0.3
      gen rep78_1 = rep78 - 0.3
      
      set scheme s1color 
      twoway rbar min max rep78, bfcolor(none) barw(0.45) horizontal || rspike  rep78_1 rep78_2 mean , ytitle("`: var label rep78'") yla(, ang(h)) legend(off) xtitle("minimum, mean and maximum Price (USD)") xsc(alt)
      Click image for larger version

Name:	minmaxmeanbar.png
Views:	1
Size:	19.3 KB
ID:	1607145

      Comment

      Working...
      X