Announcement

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

  • Cascade chart (graph with variable width bars)

    Hi. I have been trying to create this graph in Stata for quite a while now (attached in Excel). It is usually called 'cascade chart' or 'column chart with variable width bars'. I have tried to use a range of commands (including 'graph twoway bar' and 'graph bar') but I have not managed to overcome the fact that I only have continuous variables. My dataset is structured as follows: I have a panel dataset for several countries (id) and several years (time). I have data on sectoral employment shares and sectoral labour productivity for 8 economic sectors. Each of these are a unique variable, so I have 8 [sectors] x (employment + productivity) = 14 variables. This structure helps the type of calculations I have to perform, but I would consider reshaping it. The key insight of this graph is that the height of the bars measures labour productivity in each sector, while the width of the bars measures their respective share in total employment. Moreover, the area of each bar can then be seen as a (rescaled) measure of sectoral output (Yi/Ei * Ei/E = Yi/E). This graph provides a snapshot for a single country (id) and a single year (time). Would anyone be able to provide some insights on how it might be possible to implement this in Stata?

    Many thanks in advance,
    Pedro

    http://peltiertech.com/variable-width-column-charts/
    http://www.andypope.info/charts/colwidth2.htm
    Attached Files

  • #2
    Code:
    clear
    input share    agr    min    man    uti    com    tra    fin    oth
    0       10    0    0    0    0    0    0    0
    41.1    10    0    0    0    0    0    0    0
    41.1    0    0    0    0    0    0    0    0
    41.1    0    150    0    0    0    0    0    0
    42.6    0    150    0    0    0    0    0    0
    42.6    0    0    0    0    0    0    0    0
    42.6    0    0    50    0    0    0    0    0
    53.9    0    0    50    0    0    0    0    0
    53.9    0    0    0    0    0    0    0    0
    53.9    0    0    0    60    0    0    0    0
    56.1    0    0    0    60    0    0    0    0
    56.1    0    0    0    0    0    0    0    0
    56.1    0    0    0    0    40    0    0    0
    79.8    0    0    0    0    40    0    0    0
    79.8    0    0    0    0    0    0    0    0
    79.8    0    0    0    0    0    30    0    0
    85.1    0    0    0    0    0    30    0    0
    85.1    0    0    0    0    0    0    0    0
    85.1    0    0    0    0    0    0    90    0
    93      0    0    0    0    0    0    90    0
    93      0    0    0    0    0    0    0    0
    93      0    0    0    0    0    0    0    45
    100    0    0    0    0    0    0    0    45
    end
    twoway bar agr - oth share, bartype(spanning..) legend(cols(4)) ytitle(Productivity) xtitle(Labor Share)
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	13.6 KB
ID:	1295542

    Comment


    • #3
      What is the purpose of varying the width of the bars if the values you are encoding are expressed by the height of the bars? It seems that it would be a difficult graph for many people to correctly, consistently, and easily interpret given the perception of area is generally less precise that the precision of other visual encoding methods.

      Comment


      • #4
        Hi Scott, thank you very much for your reply. However, I would like to do this graph for several countries and years, so I reckon your suggestion would be quite time consuming. I was looking for code that would enable me to fetch the relevant data and automatically produce several graphs.

        With regard to the purpose of the graph, the main objective is to identify sectors where both the labour share [bar width] is large and labour productivity [bar height] is high. (The area can be an additional insight for some countries.) It is often the case that the sectors with the highest productivity levels employ very few people (e.g. mining, public utilities), while sectors that employ most of the population are usually associated with low productivity levels. I am interested in exploring productivity gaps and employment potential, so this graph is actually very useful - though I should probably sort productivity (ascending) - see picture below with a different example.

        Many thanks,
        Pedro

        Comment


        • #5

          Comment


          • #6
            This is only a bizarre graph when bars are presented in arbitrary order, as shockingly done in the sites cited in #1.

            Sensibly ordered, this is a discrete relative of, or special case of, the Lorenz curve. depending how broadly you define that; or a probability-probability plot.

            Comment

            Working...
            X