.-
help for ^histplot^
.-

Histogram for frequency distribution ------------------------------------

^histplot^ varname [^if^ exp] [^in^ range] [weight] [^, w^idth^(^#^) by(^byvar^) fr^ac ^join u^linc barplot_options ]

Description -----------

^histplot^ plots a histogram showing the frequency distribution of varname. The range of varname is divided into bins or classes of width given by ^width( )^ and the limits of each class are multiples of that width.

The default convention can be explained by example: if mpg varies from 12 to 41 miles per gallon, and width is 2, the classes will be by default 12 to almost 14, 14 to almost 16, ... , 40 to almost 42. In general, each frequency is the number >= the lower limit and < the upper limit of each class. The opposite convention is obtained by using the ^ulinc^ option.

aweights, fweights and iweights are allowed.

Options -------

^width(^#^)^ specifies the width of each class. The default is ^width(0)^, meaning that the data are treated as they are.

^by(^byvar^)^ specifies that histograms are to be drawn separately for distinct values of byvar.

^frac^ specifies that frequencies are to be displayed as fractions of the total rather than as counts. Note that the default behaviour of ^histplot^ is the opposite of ^graph, histogram^, which shows fractions unless ^freq^ is specified.

^join^ means that histogram bars should be joined together by a base line.

^ulinc^ specifies that the upper limits are to be inclusive. In the example above, they would run from just above 10 to 12, and so on. In general, each frequency is the number > the lower limit and <= the upper limit of each class.

barplot_options are options of ^barplot^.

Remarks -------

^histplot^ is a driver for ^genfreq^ and ^barplot^, which must be installed.

Examples --------

. ^histplot mpg, w(2)^ . ^histplot mpg, w(2) l2(Fraction) yla frac^

Author ------

Nicholas J. Cox, University of Durham, U.K. n.j.cox@@durham.ac.uk

Also see --------

On-line: help for @graph@, @barplot@ (if installed), @genfreq@ (if installed)