stats[statplots, histogram]  Histograms of statistical data

Calling Sequence


stats[statplots, histogram](data, , ...)
statplots[histogram](data, , ...)
histogram(data, , ...)


Description


•

The function histogram of the subpackage stats[statplots] plots a bar graph for one or more statistical lists.

•

The command histogram(data1) will tally the data in data1 into bars of equal area. Classes (ranges) contained in data1 are plotted as boxes proportional to their weight.

•

When more than one statistical list is specified, as in histogram(data1, data2, ...), a 3D plot is created. One histogram is created for each data set, and they are plotted on the same graph. The data1 plot is closest to the viewer, and each subsequent data set is behind it. The i^th data set, is plotted along the plane z=i, with the zaxis pointed away from the viewer.

•

By default, a probability histogram will be produced: the total area of the bars will be 1. This can be changed by using the area parameter; area=10 will give a histogram with the bars having a total area of 10. To make the total area of the bars equal to the total weight of the data, use area=count.

•

The parameter numbars= allows the user to specify how many divisions the data should be broken up into. If the data is spread uniformly, then numbars=y should produce a histogram with y columns. Less uniform data may result in empty columns. When this parameter is not specified, a representative default value is chosen.

•

By default, bars will be of equal area and not necessarily equal width. When using the area=... parameter, the default changes so that the bars are always of equal width.

•

Another choice is to use classes that have the same width. The function stats[transform, tallyinto] can be used to collect point data into class data. It is usually a good idea to group data into between 5 and 20 classes. The boundaries of the classes should not include actual data points.

•

One disadvantage of using histograms for the display of data is that their appearance can change drastically depending on the positions of the boundaries of the classes. This is somewhat lessened if the class marks (midpoints of the classes) are chosen to be actual data items. For example, the class 1..3 would be acceptable if the data contains the item 2, but would be rejected if the data does not contain the item 2.

•

Missing data are ignored.

•

The command with(stats[statplots]) allows the use of the abbreviated form of this command.



Examples


Important: The stats package has been deprecated. Use the superseding package Statistics instead.
>


>


>


>


Some randomly generated numbers:
>


Here is a more advanced example. Data2 was generated via a standard normal random number generator. We want to plot a histogram of this and also have the theoretical distribution.
>


frequencies:
>


default: probability histogram, equal area regions
>


>


>


probability histogram, with equal width regions, and overlay theoretical
>


>


>


>


>



