Stata 15 help for twoway connected

[G-2] graph twoway connected -- Twoway connected plots


twoway connected varlist [if] [in] [weight] [, scatter_options]

where varlist is

y_1 [y_2 [...]] x

aweights, fweights, and pweights are allowed; see weight.


Graphics > Twoway graph (scatter, line, etc.)


twoway connected draws connected-line plots. In a connected-line plot, the markers are displayed and the points are connected.

connected is a plottype as defined in [G-2] graph twoway. Thus the syntax for connected is

. graph twoway connected ...

. twoway connected ...

Being a plottype, connected may be combined with other plottypes in the twoway family, as in,

. twoway (connected ...) (scatter ...) (lfit ...) ...


scatter_options are any of the options allowed by the graph twoway scatter command; see [G-2] graph twoway scatter.


connected is, in fact, scatter, the difference being that by default the points are connected:

Default connect() option: connect(l ...)

Thus you get the same results by typing

. twoway connected yvar xvar

as typing

. scatter yvar xvar, connect(l)

You can just as easily turn connected into scatter: Typing

. scatter yvar xvar

is the same as typing

. twoway connected yvar xvar, connect(none)

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