Announcement

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

  • Graph of multi categorial variable

    Hello,

    I have various variable binary 0 if the effect in unpresent 1 if it is present in my population
    I would like to lake a graph where in the x-axis I have the name of the variable (var_1, var_2, var_3) and on the y axis the percentage of 1

    I struggle a lot to do that... I succeed to do more complex graph but that one seems to be difficult to get.

    If possible I would like to go beyond and plot the same graph but inside each vertical bar the proportion of the presence manifested by 1 of another variable var_4

    Thanks for your help

  • #2
    Code:
    webuse nlswork
    su
    graph bar msp nev_mar collgrad, over(south)
    
    ssc inst statplot
    statplot msp nev_mar collgrad, over(south) recast(bar)

    Comment


    • #3
      Originally posted by Nick Cox View Post
      Code:
      webuse nlswork
      su
      graph bar msp nev_mar collgrad, over(south)
      
      ssc inst statplot
      statplot msp nev_mar collgrad, over(south) recast(bar)
      Thanks for your answer, it is close to what I want but not exactly.
      Like this I have the picture attached.
      But instead of the bars Holter Neg I would like the percentage on the entire population (Holter neg + Holter Pos) and on the right keep the bars Holter pos.
      The best would be that each blue bars are together, red etc...
      Is something like this is possible ?
      Thanks for the help
      Attached Files

      Comment

      Working...
      X