Stata 11 help for twoway_pccapsym

help twoway pccapsym dialog: twoway -------------------------------------------------------------------------------

Title

[G] graph twoway pccapsym -- Paired-coordinate plot with spikes and marker symbols

Syntax

twoway pccapsym y1var x1var y2var x2var [if] [in] [, options]

options description --------------------------------------------------------------------- line_options change look of spike lines marker_options change look of markers (color, size, etc.) marker_label_options add marker labels; change look or position headlabel label second coordinate, not first

vertical orient plot naturally; the default horizontal orient plot transposing y and x values axis_choice_options associate plot with alternative axis

twoway_options titles, legends, axes, added lines and text, by, regions, name, aspect ratio, etc. --------------------------------------------------------------------- All explicit options are rightmost, except headlabel, vertical, and horizontal, which are unique; see repeated options.

Menu

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

Description

A paired-coordinate capped-symbol plot draws a spike (or line) for each observation in the dataset and caps these spikes with a marker symbol at each end. The line starts at the coordinate (y1var,x1var) and ends at the coordinate (y2var,x2var), and both coordinates are designated with a marker.

Options

line_options specify the look of the lines used to draw the spikes, including pattern, width, and color; see [G] line_options.

marker_options specify how the markers look, including shape, size, color, and outline; see [G] marker_options. The same marker is used on both ends of the spikes.

marker_label_options specify if and how the markers are to be labeled; see [G] marker_label_options.

headlabel specifies that labels be drawn on the markers of the (y2var,x2var) points rather than on the markers of the (y1var,x1var) points. By default, when the mlabel() option is specified, labels are placed on the points for the first two variables -- y1var and x1var. headlabel moves the labels from these points to the points for the second two variables -- y2var and x2var.

vertical and horizontal specify whether the y and x coordinates are to be swapped before plotting -- vertical (the default) does not swap the coordinates, whereas horizontal does.

These options are rarely used when plotting only paired-coordinate data; they can, however, be used to good effect when combining paired-coordinate plots with range plots, such as twoway rspike or twoway rbar.

axis_choice_options associate the plot with a particular y or x axis on the graph; see [G] axis_choice_options.

twoway_options are a set of common options supported by all twoway graphs. These options allow you to title graphs, name graphs, control axes and legends, add lines and text, set aspect ratios, create graphs over by() groups, and change some advanced settings. See [G] twoway_options.

Remarks

Remarks are presented under the following headings:

Basic use 1 Basic use 2

Basic use 1

We have longitudinal data from 1968 and 1988 on the earnings and total experience of U.S. women by occupation.

. sysuse nlswide1

. list occ wage68 ttl_exp68 wage88 ttl_exp88

+-------------------------------------------------------------+ | occ wage68 ttl_e~68 wage88 ttl_e~88 | |-------------------------------------------------------------| 1. | Professionals 6.121874 .860618 10.94776 14.11177 | 2. | Managers 5.426208 1.354167 11.53928 13.88886 | 3. | Sales 4.836701 .9896552 7.290306 12.62823 | 4. | Clerical/unskilled 4.088309 .640812 9.612672 11.08019 | 5. | Craftsmen 4.721373 1.091346 7.839769 12.64364 | |-------------------------------------------------------------| 6. | Operatives 4.364782 .7959284 5.893025 11.99362 | 7. | Transport 1.987857 .5247414 3.200494 8.710394 | 8. | Laborers 3.724821 .775966 5.264415 10.56182 | 9. | Other 5.58524 .8278245 8.628641 12.78389 | +-------------------------------------------------------------+

We graph a spike with symbols capping the end to show the movement from 1968 values to 1988 values for each observation (each occupation):

. twoway pccapsym wage68 ttl_exp68 wage88 ttl_exp88 (click to run)

For a better presentation of these data, see Advanced use in [G] graph twoway pcspike; the comments there about combining plots apply equally well to pccapsym plots.

Basic use 2

We can draw both the edges and nodes of network diagrams by using twoway pccapsym.

. sysuse network1

. twoway pccapsym y_c x_c y_l x_l (click to run)

Again, a better presentation of these data can be found in [G] graph twoway pcspike under Advanced use 2.

Also see

Manual: [G] graph twoway pcspike

Help: [G] graph twoway; [G] graph twoway line; [G] graph twoway rcapsym; [G] graph twoway pcspike, [G] graph twoway pcarrow, [G] graph twoway pcscatter, [G] graph twoway pci


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