Announcement

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

  • how would you improved presentation of this graph

    Hi i just produced the following graph with the following code for these age categories, as you can see it's visually crowded...I also tried to enlarge the graph (making the window larger)

    What are you recommendations on how to improve it

    here's the code i used

    Code:
    graph hbar (percent) if treatment ==1 & failure==1, over(reason) over(agegrp) asyvars
    Perhaps is there a way to show the top 3 categories of (percent)?
    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	32.5 KB
ID:	1744016

    Last edited by Martin Imelda Borg; 21 Feb 2024, 04:45.

  • #2
    You have 7 age-groups -- noting that 50-59 appears twice, however, which is perhaps an error for 50-54 and 55-59 -- and perhaps 12 reasons, so it's going to be hard to make this readable considering that your final graph must detail the 12 or so reasons.

    Showing % of everyone is not crazy but many if not most purposes would be better served by showing % of the age-group.

    Comment


    • #3
      Showing % of everyone is not crazy but many if not most purposes would be better served by showing % of the age-group.

      hi can you clarify what you mean by the above ? Perhaps giving an example So I can understand what you mean ?

      Comment


      • #4
        I didn't think it was a subtle point. But here goes. It seems clear that the reason you get (say) low percents for older people is essentially that there are fewer of them. If the concern is with e.g. what % of people are 90+ AND cite reason 7, then your graph is the one to use. Otherwise, many questions relate to conditional distributions of reasons for each age group.

        To get concrete suggestions for different graphs, I suggest showing the data it uses, e.g. what is shown as a result of

        Code:
        contract reason agegroup if treatment ==1 & failure==1
        dataex

        Comment


        • #5
          Martin Imelda Borg seems to have lost interest in his own thread. See https://www.statalist.org/forums/for...ontract-option

          Comment


          • #6
            Yes, I made progress overnight, deviating from improving the visualisation to using the top2-3 reasons, which is off-topic to the concept of the thread here; therefore, I wrote a new post.

            However, related to this thread. Is there a way how to use the graph in 1 but instead focus on the low value horizontal bars, therefore making it look bigger. If this make sense having a y scale up to 4%
            With regards to those >4% THEY will have the labels within the bars.

            Comment


            • #7
              #4 still stands. To suggest code (that works at least moderately well) I need a data example.

              I won't try to guess otherwise.

              Comment

              Working...
              X