Announcement

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

  • rbar touching

    I am creating a twoway horizontal rbar in Stata but cannot seem to get the bars to touch/be adjacent to one another. I have played around for some time now and would be grateful if anyone you might know the solution off the top of his/her head could provide some advice. With thanks in advance.

    graph twoway /*
    */ (rbar begin_d1`spell_d1' end_d1`spell_d1' id, horizontal barwidth(0.1) xlab(0(10)100) color(navy)) /*
    */ (rbar begin_d0`spell_d0' end_d0`spell_d0' id, horizontal barwidth(0.1) xlab(0(10)100) color(maroon))

  • #2
    Without a reproducible example, it's hard to see what's wrong. The key to bars touching in the direction they are stacked is that the end of one bar is the beginning of another. The key to bars touching in the other direction is barwidth() which you are aware of. Your command has the form

    (rbar begin11 end11 id) (rbar begin00 end00 id)

    so I wouldn't expect the bars to touch unless there was an equality of values.

    Comment


    • #3
      Hi Nick - thanks very much for your quick answer. Indeed my values are not equal and hence why I can't get them to touch. Thanks also for the tip to provide reproducible examples. Will aim to do so when posting in the future. Meredith

      Comment


      • #4
        A tip that may be related: you earlier asked about flips back and forth between one state and another. For data of that kind, line with c(J) may work well.

        Comment

        Working...
        X