Stata 15 help for gr7hist

help gr7hist (out-of-date command) -------------------------------------------------------------------------------

Warning

This help file documents the old version of Stata's graph command. See graph for the modern version.

Stata runs the old version of graph whenever graph is invoked under version control (see version) or when you use the graph7 or gr7 command.

Graph histograms (graph7, histogram command)

{graph7 | gr7} [variable] [weight] [if exp] [in range], histogram [common_options bin(#) {freq | percent} normal[(#,#)] density(#)]

common_options See help ------------------------------------------------------ title and axes options gr7axes symbol and line options gr7sym color and shading options gr7color saving, printing, & multiple image options gr7other ------------------------------------------------------

by is allowed; see by.

Description

graph7 ... , histogram ... specifies a histogram is to be drawn; this is the default for graph7 when only one variable is specified and so the histogram option is seldom typed. For an introduction to graph7, see graph7.

Options unique to histogram

bin(#) specifies the number of intervals to use for accumulating the histogram. The default is bin(5).

freq and percent affect how the vertical axis is labeled. freq labels the vertical axis in frequency rather than fractional units. percent labels the axis in percent.

normal[(#,#)] draws a normal density over the histogram. normal by itself will calculate and use the observed mean and standard deviation. normal(1,2) would overlay a normal with mean 1 and standard deviation 2.

density(#) is used only with normal; it specifies the number of points along the density to be calculated. Default is density(100).

Examples

Since histogram is the default for graph7 with one variable

. graph7 x (draws a histogram of x)

. graph7 x, bin(11) (uses 11 bins for histogram)

. graph7 x, normal(10,3) (overdraws a normal mean 10 s.d. 3 density)

A more involved example:

. gr7 tempjuly, bin(9) log normal xlabel noxaxis yline ylabel xline(58,100) t1("(Based on 956 U.S. Cities)") by(region) total

Also see

The eight graph7 types are specified as options. The other seven types are

Option Graph type See help ---------------------------------------------------- twoway Two-way scatterplot gr7twoway matrix Two-way scatterplot matrix gr7matrix oneway One-way scatterplot gr7oneway box Box-and-whisker plot gr7box star Star chart gr7star bar Bar chart gr7bar pie Pie chart gr7pie ----------------------------------------------------

Help: [G-2] graph7, gr7axes, gr7color, gr7other, gr7sym; [R] cumul, [R] histogram, [R] stem


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index