Stata 15 help for gr7twoway

help gr7twoway (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 two-way scatterplots (graph7, twoway command)

{graph7 | gr7} [varlist] [weight] [if exp] [in range], twoway [common_options jitter(#) rescale rbox {y|x|r}reverse]

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 ... , twoway ... specifies a two-way scatterplot; this is the default for graph7 when more than one variable is specified. twoway may be combined with oneway (see gr7oneway) or box (see gr7box), but in that case, you must specify twoway explicitly.

For an introduction to graph7, see graph7.

Options unique to twoway

jitter(#) adds spherical random noise to each point before graphing, where # represents the magnitude of the noise as a percent of graphical area. The default is jitter(0). jitter(5) is a large amount. (This is useful to keep categorical data from overplotting.)

rescale scales each y-variable independently. If there are two y-variables, the scale of the first is presented on the left (x) axis and the scale for the second on the right (r) axis. If there are more than two y-variables, no vertical scale is labeled.

rbox places a rangefinder box plot on the graph.

{y|x|r}reverse reverses the indicated scale to run from high-to-low.

Examples

Since twoway is the default for graph7 with more than one variable:

. graph7 y x (graphs y against x)

. graph7 y1 y2 x (graphs y1 and y2 against x)

Here are more involved examples:

. gr7 mpgfor mpgdom weight, xlog ylab xlab l1("Mileage (mpg)")

. gr7 clnsl herd time, c(ll) rescale ysca(2000,3500) rsca(700,1100) ylab(2500(250)3500) rlab(700(50)900) xlab(1967(1)1975) t1(U.K. Pig Production)

This one additionally uses the box style:

. gr7 mpg displ, two box rbox ylab xlab border

Also see

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

Option Graph type See help ---------------------------------------------------- histogram histogram gr7hist 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] diagnostic plots


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