Axes for the OVERLAYEQUATED
layout are similar to axes for the OVERLAY layout with the following
exceptions:
-
Both axes are always of TYPE=LINEAR.
-
Some axis
options that always apply to both axes are specified in a COMMONAXISOPTS=
option. Some of the supported options are INTEGER, TICKVALUELIST,
TICKVALUESEQUENCE, VIEWMAX, and VIEWMIN.
-
XAXISOPTS=
and YAXISOPTS= options are supported (with a different set of suboptions
from those of OVERLAY), but X2AXISOPTS= and Y2AXISOPTS= options are
not supported. Some of the supported options are DISPLAY, LABEL, GRIDDISPLAY,
DISPLAYSECONDARY, OFFSETMAX, OFFSETMIN, THRESHOLDMAX, THRESHOLDMIN,
and TICKVALUEFORMAT.
-
No independent secondary
(X2, Y2 ) axes are available, although secondary axes that mirror
the primary axes can be displayed. The XAXIS= and YAXIS= options are
ignored.
Managing Axes in an OVERLAY Layout discusses many of the axis options
that are available for managing graph axes.
To illustrate how to
control axes for the equated layout, we will look at a simplified
version of the PPPLOT template that is supplied with PROC UNIVARIATE,
which is delivered with Base SAS. The following code shows a SAS program
that can be used to run PROC UNIVARIATE:
ods graphics on;
proc univariate data=sashelp.heart;
var weight;
ppplot / normal square;
run;
quit;
When the code is run,
it creates the following plot. The plot uses the PPPLOT template,
which is stored in the BASE.UNIVARIATE.GRAPHICS folder of the SASHELP.TMPLMST
item store:
In PROC UNIVARIATE,
the PPPLOT statement creates a probability-probability plot (also
referred to as a P-P plot or percent plot), which compares the empirical
cumulative distribution function (ecdf) of a variable with a specified
theoretical cumulative distribution function such as the normal. If
the two distributions match, the points on the plot form a linear
pattern that passes through the origin and has unit slope. Thus, you
can use a P-P plot to determine how well a theoretical distribution
models a set of measurements.
The supplied PPPLOT
template uses several dynamics to pass in values for options, but
in essence, the following template is equivalent. The dynamics for
the title and axis labels have been converted into literals appropriate
for this set of data.
proc template;
define statgraph pp_plot;
begingraph;
entrytitle "P-P Plot for Weight";
entryfootnote halign=right "Derived from PPPLOT template";
layout overlayequated / equatetype=square
xaxisopts=(label="Normal(Mu=153.09 Sigma=28.915)"
thresholdmin=1 thresholdmax=1)
yaxisopts=(label="Cumulative Distribution of Weight"
thresholdmin=1 thresholdmax=1)
commonaxisopts=(viewmin=0.0 viewmax=1.0) ;
scatterplot x=Theoretical y=Empirical;
lineparm x=0 y=0 slope=1 / lineattrs=GraphFit;
endlayout;
endgraph;
end;
run;
This simplified template
produces a similar plot if it is rendered with the same data as the
UNIVARIATE plot. An ODS OUTPUT statement can convert the output object
from UNIVARIATE into a SAS data set:
ods graphics on;
ods select ppplot;
ods output ppplot=ppdata;
proc univariate data=sashelp.heart;
var weight;
ppplot / normal square;
run;
quit;
proc sgrender data=ppdata
template=pp_plot;
run;
The following template
modifies the equated axes, as shown in the next graph:
layout overlayequated / equatetype=square
xaxisopts=(label="Normal(Mu=153.09 Sigma=28.915)"
thresholdmin=1 thresholdmax=1
tickvalueformat=3.2
display=(label tickvalues)
displaysecondary=(tickvalues)
griddisplay=on)
yaxisopts=(label="Cumulative Distribution of Weight"
thresholdmin=1 thresholdmax=1
tickvalueformat=3.2
display=(label tickvalues)
displaysecondary=(tickvalues)
griddisplay=on)
commonaxisopts=(viewmin=0.0 viewmax=1.0
tickvaluesequence=(start=0 end=1 increment=.25) );