Announcement

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

  • Mirrored hbar stata

    Dear all,

    I am looking for a solution to recreate a hbar graph as the one that I attached. So far I've the solution I attach, with the following simple code:

    Code:
    graph hbar tradevalue , over(iso, sort(1)) by(trade)
    but as you will notice, it's not entirely satisfactory (leaving aside the further refinements it would need).

    Does anybody have any suggestion about how I could make it more similar to the original one?

    Thanks in advance,
    Kind regards,
    Emanuele
    Attached Files

  • #2
    A couple of suggestions:

    Start with twoway bar instead of graph hbar
    Create a value that is the opposite in direction such as: replace Imports = -Imports
    Search for pyramid graph in the Web.
    Best regards,

    Marcos

    Comment


    • #3
      In the Stata Graphics Reference Manual PDF included in your Stata installation and accessible from Stata's Help menu, if you look at the documentation for the graph twoway bar command as Marcos suggested, there is (starting on page 209 in Version 16) a section titled "Advanced use: Population pyramid" that discusses this type of graph in detail.

      Comment


      • #4
        Dear William and Marcos,

        thank you for your replies, I will take a look at that then.

        Have a nice day,
        Emanuele

        Comment


        • #5
          I don't understand the enthusiasm for pyramids, even in their home territory of showing age and sex composition for populations. In that domain small fluctuations in #males/#females or its reciprocal around 1 are likely to be interesting and even important, but such fluctuations can be hard to spot when the mental task is to lift up one bar and superimpose it on its twin.

          See if so inclined my posts at https://www.statalist.org/forums/for...oway-bar-graph with (1) a reference (others more than welcome) (2) alternative suggestions using data. The line chart there isn't quite what you need here, naturally.

          Further, it seems likely that logarithmic scale will help, which to me rules out bar charts absolutely and rules in dot charts.

          The dataset behind #1 is small enough to post here.

          Comment

          Working...
          X