Announcement

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

  • Log-log histograms

    Dear all,

    is there an easy way to create log-log histograms in Stata like the one reproduced below?

    Click image for larger version

Name:	logloghistogram.jpg
Views:	1
Size:	81.6 KB
ID:	162878

    Thank you very much!

  • #2
    It looks like a scatterplot rather than a histogram to me! Have you looked at help axis_scale_options, in particular the suboptions to use a logarithmic scale? Or am I missing something?

    Comment


    • #3
      You're right, it looks like a scatterplot. I got the idea for this plot from:

      Healy, K., and J. Moody. 2014. "Data Visualization in Sociology." Annual Review of Sociology 40:105-128. doi: 10.1146/annurev-soc-071312-145551

      They write:

      "Many of the distributions typically studied in sociology are extremely skewed and difficult to display as simple histograms. ... Figure 7a presents a standard histogram [as in -histogram x, percentage discrete-], whereas Figure 7b follows the convention now common in the physical sciences of presenting the distribution on a log-log scale. ... a log-log histogram is much better at revealing details in the 'long tail' of the distribution."

      Given that Healy and Moody describe the log-log histogram as a common convention, I was hoping that this was available as a default in Stata which I just happened to have overlooked.

      Comment


      • #4
        Thanks for the article reference. Some interesting stuff in it. Sorry if I wasn't clear in my message. It wasn't simply a pedantic point about what to call that type of graph that I was trying to make. Rather, I was suggesting that you could draw a graph of the format that you show straightforwardly in Stata using a graph twoway scatter combined with suboptions to place both x-axis and y-axis on a log scale. That's pretty close to a "default" to me.

        Comment


        • #5
          I believe you can generate such a plot with
          twoway__histogram_gen myvar, gen(y x) width(1) fraction
          scatter y x, xscale(log) yscale(log)
          where you may want to adjust the width() option, and then tart up the scatterplot.

          Comment


          • #6
            Thanks! (I am clearly lazier than you.)

            Comment


            • #7
              My strong impression is that this graph (evidently bin frequency or probability vs value, both scales logarithmic) is not nearly so common in physical science as a plot of the reverse cumulative frequency or probability distribution with logarithmic x axis for value and logarithmic y axis for pr(X >= x) or #(X >= x). distplot from SJ is one possibility for such graphs.

              Comment

              Working...
              X