Announcement

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

  • graph hbox qs

    Hey guys,

    i have a question about relabel function, so here is my command

    graph hbox age, over(morethan50k, relabel (1"lots of money" 2"less money")) over(sex, relabel(1"male" 2"female")) name(graph1, repla
    > ce) nooutsides asy
    my question is, when I am trying re label option, I use 1 and 2, those are the ones that worked, but I coded morethan50k as 0 and 1 (1 being more than 50k), why stata wont relabel based on the values inserted in the cells, why 1,2. and not 0,1

    does my question make sense?

    thanks

  • #2
    I guess one is for the first label, 2 is for the second, etc. Once when I first came across this topic, it striked me as odd as well. But I gather that keeping in mind the sequence may be more on the safe side then remembering the codes, which, by the way, could be 3, 23 and 345, and that would be quite a challenge to memorize. Hopefully that helps.
    Best regards,

    Marcos

    Comment


    • #3
      All documented. You have to click a bit (so what else is new?) but here it is off (not at)

      Code:
      help graph bar
      That is, # refers to category number, which is determined by sorting the unique values of the
      variable (here sex) and assigning 1 to the first value, 2 to the second, and so on. If you are
      unsure as to what that ordering would be, the easy way to find out is to type

      . tabulate sex
      Strictly relabel() is a suboption, not a function.

      Comment


      • #4
        thanks both, make sense. I am still in learning process and definitely help bar does help! lol

        Comment

        Working...
        X