Solved – Log scale in histogram + Stata

data transformationdata visualizationlogarithmstata

Is there some way to have Stata create bin sizes for a histogram such that when you plot the histogram on a log scale, the bins will all appear to have the same width (visually, not numerically) on the plot? Basically, instead of a histogram with fixed bin sizes, I want a histogram with variable bin sizes that increase at the same rate the log axis scale is increasing (small bin sizes at the minimum end of the axis, large bin sizes at the maximum end of the axis). I know how to make a histogram with variable bin sizes, but this would require trying to figure out what all the bin boundaries should be, and then feeding a huge array of numbers to the histogram constructor. How can I get this kind of logarithmically increasing bin size in my histogram?

Best Answer

Resources for Stata-specific help can be found under Internet Support for Statistics Software.

Of course, a general technique is to take the logs of your data values and then make a regular histogram. Here's the same data in raw form and in log form.

enter image description here

enter image description here