1
$\begingroup$

I know how to normalize histogram (so that the area =1) with the same bin width, but how to do it when the histogram has different bin width? Any idea?

$\endgroup$
6
$\begingroup$

The principle of a histogram is that for bins that touch (i.e. no overlaps or gaps), bar height should be proportional to bin frequency/bin width. If bin width is constant, then it can be left out of the calculation.

It's conventional to present histograms as showing frequencies, percents, or proportions, and that's all possible and legitimate with constant bin width.

With varying bin width, however, the choices include (a) probability density (b) frequency density (c) frequencies scaled to some standard bin width (really (b) with possibly differing magnitudes).

The principles transcend software choice, but more discussion, and some references, can be found in this Stata FAQ.

If you have varying bin widths, that has no impact on the principle that the total area of the bars represents total frequency or total probability of 1. If you draw the individual bars correctly, that will be satisfied.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ +1 These principles are illustrated in some posts on our site that use histograms. For instance, they show up in the generalization to 2D histograms I discuss at stats.stackexchange.com/a/24590. $\endgroup$ – whuber Mar 19 '14 at 20:22
  • $\begingroup$ @whuber Quite so, and thanks. For "area" read "volume" for the 2D case. In principle, a histogram could be defined for more dimensions, but I am having problems showing one within this comment box. $\endgroup$ – Nick Cox Mar 19 '14 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.