Announcement

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

  • histogram label position

    Hi everybody, a stupide question here, but I am not able to find sollutions. I am running the following code. I would ask you if there is any way to center the xlabel on the bar. That because when I change bar size the xlabel does not move.
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input byte(high grade)
    0 1
    0 1
    0 1
    0 1
    0 1
    0 0
    0 0
    0 0
    0 0
    0 0
    0 0
    1 0
    1 0
    1 0
    1 0
    1 0
    1 0
    1 0
    1 1
    1 1
    1 1
    1 1
    1 1
    1 1
    1 1
    end
    twoway histogram high, percent by(grade, row(1)) width(0.9) barwidth(0.2) graphregion(color(white)) xlabel(0 "non high" 1 "high")

  • #2
    You need (mostly) the discrete option.

    Consider this as a better start:

    Code:
    twoway histogram high, discrete percent by(grade, row(1)) barwidth(0.2) graphregion(color(white)) xlabel(0 "non high" 1 "high")

    Comment


    • #3
      That said, a binary outcome and a binary predictor boils down to two means, as the % scoring 1 = 100 MINUS % scoring 0. Do you need a graph at all?

      Comment

      Working...
      X