Histogram

 

Menu location: Graphics_Histogram.

 

The frequency distribution histogram is plotted vertically as a chart with bars that represent numbers of observations within certain ranges (bins) of values.

 

The variable that you select is divided into m ranges (bins, bars). The variable is then sorted and the first k values less than or equal to the upper limit of the first bin are counted as the frequency of the first bin. This counting is then repeated for each bin, and bars are plotted to represent the counts. The numbers displayed on the x axis are the middle values (mid-points) for the value range of each bin; when there are more than twenty bins, or the labels would crowd the axis, only every second, third or further mid-point is labelled.

 

StatsDirect chooses the number of bins by Doane's rule unless you select another rule in the chart options; the StatsDirect Mid-point rule selects a "neat" number of bins and "neat" mid-point values for your data. You may over-ride this selection and set your own bin specifications when prompted.

 

You may opt to superimpose a normal/Gaussian curve on a histogram plot.

 

The text-based version of this plot prints the number of data in each bin.

 

 

Example

Test workbook (Other worksheet: IgM, Log(base 10): IgM).

 

The charts above are of the serum IgM concentrations, in g/l, of 298 children aged 6 months to 6 years (Altman, 1991), which the reference range example also uses: first as measured, then as logarithms to base 10. The Graphics worksheet holds the same data as a frequency table (IgM Values, Frequency).

 

To draw the histogram in StatsDirect open the test workbook using the file open function of the file menu. Then select Histogram from the Graphics menu and select the column marked "IgM" when prompted for data. The number of bins is chosen by Doane's rule unless you pick another rule in the chart options (Sturges, Freedman-Diaconis, Stata, Shimazaki-Shinomoto, or the StatsDirect Mid-point rule of the "neat" mid-points that the charts above show) or enter your own number of bins there; the same options overlay the normal curve. The bins are equal intervals from the smallest value to the largest, and the x axis is labelled at their mid-points.

 

For this example, the chart prints no figures; its bars show:

 

Distribution of IgM

Bins = 13 (Doane's rule), width = 0.338462

Mid-points: 0.27 0.61 0.95 1.28 1.62 1.96 2.30 2.64 2.98 3.32 3.65 3.99 4.33

Counts: 56 105 92 22 11 8 1 2 0 0 0 0 1

 

Distribution of Log(base 10): IgM

Bins = 11 (Doane's rule), width = 0.150292

Mid-points: -0.925 -0.775 -0.624 -0.474 -0.324 -0.173 -0.023 0.127 0.277 0.428 0.578

Counts: 3 0 7 19 59 73 92 28 14 2 1

 

The IgM concentrations are skewed to the right, with a tail that reaches 4.5 g/l, so most of the bins above 2 g/l are empty or nearly so. Their logarithms are close to symmetrical, and the normal curve overlaid on the second histogram (the normal distribution with the mean and standard deviation of the logarithms, scaled to the counts) fits them well, which is why the reference range example works with the logarithms.