Announcement

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

  • Drawing a bar graph with two categories and two variables out of a pivot table (tableau croisé)

    Hello Stata people;

    I'm using Stata 13.1 version, and I'm working with this small data:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str12 Assets long(Average Median)
    "Gross assets" 308000 172000
    "Net assets"   266000 121000
    end
    It is a data showing distribution parameters (the average and the median) for two categorical variables (Gross assets and Net assets). The idea is to draw a bar graph which shows the average and the median for the first category at one side, and the average and the median for the second category at the other side, I also want to have the two bars of the average for the two categories in one color, and the two bars of the median for the same two categories in another color.

    Any help please?

    With many thanks!

  • #2
    Code:
    graph bar (asis) Average Median, over(Assets) ylabel(,format(%9.0gc))
    This will produce:
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	53.6 KB
ID:	1780171
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Maarten Buis Thanks ! That's what I was looking for

      Comment

      Working...
      X