Announcement

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

  • Extracting values used in creating a bar graph

    Dear Statalist community,

    I wondered if I could ask you for some advice on how to extract data that Stata uses to create illustrations, such as a bar graph. In my case, I make some extensive bar graphs showing the use of certain dose strengths a type of medication across several countries and time periods, in which I would like to put the exact estimates behind the figure in a supplemental section of my paper.

    The command I use is constructed like this:
    graph bar medication_strength1 medication_strength2 medication_strength1or2, over(country) over(time_period) stack

    Is there an option to extract a table showing the values used to construct a bar graph like this?

    Thank you,
    Håkon


  • #2
    It is possible, but your are better of creating those values directly, e.g. with the table command
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      In addition, you can get a dataset with just those results (which will be means) with

      Code:
      collapse medication_strength1 medication_strength2 medication_strength1or2, by(country time_period)
      It may be a good idea to record other properties too.

      Comment


      • #4
        Dear Nick and Maarten,

        Thank you for your swift and helpful replies! Both options worked out, especially the collapse command.

        Best,
        Håkon

        Comment

        Working...
        X