Announcement

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

  • Help with bar graph with error bars

    Hello all,

    I'm having trouble getting the bar graph exactly how I want it. Here's the collapsed data, where lb and ub are the lower and upper bounds for the errors:

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(xx_island urban woman perc_indigenous lb ub)
    0 0 0   .337007 .30525145 .37645414
    0 0 1  .3776891  .3437194  .4176471
    0 1 0  .2905122  .2712949  .3142721
    0 1 1 .29768202 .27791074  .3218079
    1 0 0 .38662195 .33849835   .446679
    1 0 1  .3997391  .3433408     .4713
    1 1 0  .3038693 .26285684  .3668763
    1 1 1 .30063725  .2646368  .3534003
    end
    label values xx_island xx_lbl
    label def xx_lbl 0 "Rest of the State", modify
    label def xx_lbl 1 "XX Island", modify
    label values urban urban_lbl
    label def urban_lbl 0 "Rural", modify
    label def urban_lbl 1 "Urban", modify
    label values woman woman_lbl
    label def woman_lbl 0 "Men", modify
    label def woman_lbl 1 "Women", modify

    What I want is to basically add error bars to this graph:
    Code:
    graph bar perc_indigenous, over(woman) over(urban) over(xx_island)



    Click image for larger version

Name:	Graph_example.png
Views:	3
Size:	45.0 KB
ID:	1725427

    I know that to add the error bars I have to use graph twoway with bar and rcap, however, I'm not sure how to get it to work. Thanks in advance!


    Attached Files

  • #2
    Duplicate post. Please see https://www.statalist.org/forums/for...ith-error-bars

    Comment

    Working...
    X