Agriculture Reference
In-Depth Information
presenting the same data. Using the Large Onion Dataset 2001-02,
create both a box plot and histogram of the sugar variable. Enter first
the command
graph hbox sugar
This creates a horizontal box plot of the sugar data. At this point,
save the graph in the Stata Graph (*.gph) format and then enter the
following command:
histogram sugar, normal
This creates a histogram of the same data with the normal distribu-
tion curve visible. Again, save this graph in the Stata Graph (*.gph)
format. At this point, because computer path names are going to be
different on each machine, use the menu item Table of graphs under
the Graphics menu. Select the Browse… button to select your graphs.
First, select the histogram and click Accept. Next, do the same for
the box plot graph. Next, select the Options button at the top of the
dialog box and under Layout: select Columns from the drop-down
menu. Below this are the number of columns, which should be 1.
Finally, click the OK button. This will create a graph with both the
histogram and box plot together, one above the other. You may notice
that the x -axis for both graphs does not line up. This can be corrected
by selecting the Graph Editor button and then double clicking the
x -axis of the box plot. In the dialog box that opens, select the Scale
button and click the box Extend range of axis scale. At this point,
you will be adjusting the Lower limit (< = 6.8). You can try various
values to see how the scale on the box plot x -axis changes. A value
of 6.4 appears to line up the two axes for the histogram and box plot
(Figure 9.10).
The last two items on the Graphics menu are Manage graphs and
Change scheme/size. The Manage graphs has several subitems, which
allow for the management of graphs in memory including changing
their names, copying, dropping, describing, and changing the graph in
memory. Changing the scheme or size lets you quickly change the over-
all look and size of the graphs in memory. More details about graphing
will continue in the next chapter on correlation and regression.
Search WWH ::




Custom Search