
Much of this is covered directly or indirectly in the paper cited. Label axes in terms of raw scale, not logarithms. However you can create frequency weights that will be multiples of the probability weights and agree in precision to any desired accuracy. The problem with sampling weights is that they can be non-integral. A scatter plot of log frequency against midpoint of bins.Ĥ. The histogram, kdensity, and cumul commands all take frequency weights, which must be integers. Use equal width bins on that scale to get frequencies and then log the frequencies.ģ. If you include normal at the end of the command graph varname, histogram. The recipe I suggest for your situation - provided that you recognise that zeros can't be handled - isĢ. because when we only have one variable Stata graphs a histogram as a default.
STATA HISTOGRAMS FULL
gives a full discussion of this territory, or at least the fullest discussion I know. That said, there is a defence of this practice for counts: using the possible minimum of 1 with logarithm zero as base is not quite arbitrary. To compute means and standard deviations of. Plot a histogram of a variable: graph vn, bin(xx) General commands. Warping the frequency axis violates that principle. Some Stata Commands General Plotting Commands. The key principle to a histogram is that bar area has a direct interpretation as probability or frequency. Stata's result that puzzled you is best interpreted as a signal implying that your request is inconsistent with how histograms work. If you ask for log scale, that isn't banned but it makes no sense to Stata as Stata always tries to start the bars at zero. The people who wrote the histogram commands agree with that opinion of mine. Providing you realise that and that is what you want, then so be it.įor all that you can find examples in published literature, bars on a logarithmic scale (so that there is an arbitrary base to the bars) are to me graphically obnoxious. Taking logarithms maps your zeros to missing and omits them from any display thereafter. Values of zero are inconsistent with a logarithmic scale.
