Object Reference : Graph Creation Commands
  
 
xypair
Display an XY pairs graph (if possible).
The data will be plotted in pairs, where the first two series or columns are plotted against each other, the second two series or columns are plotted against each other, and so forth. If the number of series or columns is odd, the last one will be ignored.
XY line graphs are simply XY plots with lines turned on and symbols turned off (see Graph::setelem). The xypair graph type is equivalent to using xyline with the “mult=pairs” option indicating that the data should be graphed in pairs.
Syntax
xypair(options) o1 o2 [o3 ... ]
object_name.xypair(options) [auxiliary_spec(arg)]
Following the xypair keyword, you may specify general graph characteristics using options. Available options include plotting the data in multiple graphs, template application, and adding axis extensions.
The optional auxilary_spec allows you to add fit lines to the scatterplot (regression lines, kernel fit, nearest neighbor fit, orthogonal regression, and confidence ellipses; see “Auxiliary Spec”).
Options
Scale options
 
 
a (default)
Automatic single scale.
d
Dual scaling with no crossing.
x
Dual scaling with possible crossing.
n
Normalized scale (zero mean and unit standard deviation).
ab=type
Add axis border along data scales, where type may be “hist” or “h” (histogram), “boxplot” or “b”, “kernel” or “k”.
(Note: axis borders are not available for panel graphs with “panel=” options that involve summaries: mean, median, etc.)
Multiple series pair options
 
m
Plot XY lines in multiple graphs.
Template and printing options
 
o=template
Use appearance options from the specified template. template may be a predefined template keyword (“default” - current global defaults, “classic”, “modern”, “reverse”, “midnight”, “spartan”, “monochrome”) or a graph in the workfile.
t=graph_name
Use appearance options and copy text and shading from the specified graph.
b / -b
[Apply / Remove] bold modifiers of the base template style specified using the “o=” option above.
w / -w
[Apply / Remove] wide modifiers of the base template style specified using the “o=” option above.
reset
Resets all graph options to the global defaults. May be used to remove existing customization of the graph.
p
Print the graph.
The options which support the “–” may be preceded by a “+” or “–” indicating whether to turn on or off the option. The “+” is optional.
Note that use of the template option will override the pair and line settings.
Graph data options
The following option is available in categorical graph settings:
 
contract=key
Contract the data as specified by key, where key may be: “mean”, “median”, “max”, “min”, “sum”, “var” - variance, “sd” - standard deviation, “sumsq” - sum of the squared values, “skew” - skewness, “kurt” - kurtosis, “nas” - number of missing values, “obs” - number of observations, “unique” - error if the series is not identical for all observations in a given group, “first” - first observation in category using workfile order, “last” - last observation in category using workfile order, “quant(quantile)” - where quantile is a number between 0 and 1.
Panel options
The following option applies when graphing panel structured data.
 
panel=arg (default taken from global settings)
Panel data display: “stack” (stack the cross-sections), “individual” or “i” (separate graph for each cross-section), “combine” or “c” (combine cross-section graphs in a single frame), “mean” (plot means across cross-sections), “median” (plot median across cross-sections).
(Note: more general versions of these panel graphs may be constructed as categorical graphs.)
Basic examples
xypair age height weight length
displays XY-line plots with AGE on the horizontal and HEIGHT on the vertical axis, and WEIGHT on the horizontal and LENGTH on the vertical axis.
group g1 age height weight length
g1.xypair
plots the same graph using the named object G1.
g1.xypair(m, ab=boxplot)
displays the same information in multiple frames with boxplots along the axes.
g1.xypair(t=scat2)
displays the XY-line pair graphs, using the graph object SCAT2 as a template.
g1.xypair(d, ab=hist)
shows the paired XY-line plots with dual scales and no crossing, and histograms along the borders.
Panel examples
g1.xypair(panel=combined)
displays XY-line graphs in a single frame, with different lines types and colors for different cross-sections pairs.
g1.xypair(panel=individual)
displays the graphs for each of each cross-section in a different frame.
g1.xypair(panel=stacked)
constructs a single frame graph with lines drawn from the beginning of the stacked panel to the end.
g1.xypair(panel=mean)
constructs line graphs for pairs of series using the mean values computed across cross-sections (for a given period), and displays them in a single frame.
Categorical examples
group cgrp income consumption sales revenue
cgrp.xypair within(sex)
displays a paired data line graphs categorized by values of sex, with both categories displayed in the same graph frame using different line types and colors.
cgrp.xypair(contract=mean) within(state)
computes mean values for the series in CGRP for each STATE category, and displays the results in a single graph frame.
cgrp.xypair across(state) within(sex)
displays line plots for data with each STATE value in different frames. Within each frame, the data for each value of SEX are drawn as a separate line.
Cross-references
scat and xyline are specialized forms of XY graphs.
See “Graphing Data” for a detailed discussion of graphs in EViews, and “Templates” for a discussion of graph templates. See Graph::graph for graph declaration and other graph types.