SAS Macro Programs: catplot
$Version: 1.4 (9 Nov 2000)
Plots for logit models fit by PROC CATMOD
The catplot macro is designed to plot observed and/or predicted
values for logit models fit by the CATMOD procedure. The macro uses
the output data set produced with the OUT= option on the RESPONSE
statement. This data set normally contains both logit values
(_type_='FUNCTION') and probability values (_type_='PROB'). Either
set may be plotted, as specified by the TYPE= parameter.
The horizontal variable may be character (XC=) or numeric (X=).
A separate curve is drawn for each value of the CLASS= variable,
connecting predicted values, with optional standard error bars,
and separate plots are drawn for each value of the BYVAR= variable.
The catplot macro is called with keyword parameters. The arguments
may be listed within parentheses in any order, separated by commas.
response / out=logits;
model labour = husinc children;
%catplot(data=logits, x=husinc, y=_pred_, class=labor, byvar=children);
- The name of the SAS dataset to be plotted, which must be
an output data set from PROC CATMOD. If DATA= is not
specified, the most recently created data set is used.
- Name of a numeric factor variable to be used as the horizontal
variable in plots. Use the XC= parameter to specify a
character variable. You must specify either the X= or XC=
- Name of a character factor variable used as the horizontal
variable in plots.
- Name of the ordinate variable. Y=_PRED_ plots the predicted
value; Y=_OBS_ plots the observed value.
- The name of a factor variable, used to define separate curves
which are plotted for each level of this variable.
- Name of one or more factor variables to be used to define
multiple panels in plots.
- Name of a SAS format used to format the value of BYVARs
for display in one panel of the plot(s).
- The type of oobservations to be plotted. TYPE=FUNCTION (the
default) gives plots of the logit value; TYPE=PROB gives
plots of the probability value.
- Standard error multiple for confidence intervals around
predicted values, e.g., Z=1.96 gives 95% CI. To suppress error
bars, use Z=0. The default is Z=1, giving 67% CI.
- Name of a SAS format used to format the value the CLASS=
variable for display in each panel of the plot(s).
- Specifies whether the values of the CLASS= variable should
be labelled by annotation in the plot or by a legend. If
CLSIDE=LEFT or CLSIDE=FIRST, CLASS= values are written at the
left side of each curve. If CLSIDE=RIGHT or CLSIDE=LAST,
CLASS= values are written at the right side of each curve.
If CLSIDE=NONE, CLASS= values appear in the legend.
- Name of a SAS format used to format the values of the
- Name of an additional input annotate data set
- List of SAS/GRAPH symbols for the levels of the CLASS= variable.
There should be as many symbols as there are distinct values of
- List of SAS/GRAPH colors for the levels
of the CLASS=variable. There should be as many colors as there
are distinct values of the CLASS=variable.
- List of SAS/GRAPH line styles for the
levels of the CLASS=variable. There should be as many lines as
there are distinct values of the CLASS=variable.
- Axis statement for custom horizontal axis, e.g., HAXIS=AXIS2
- Axis statement for custom response axis, e.g., VAXIS=AXIS1. If
no axis statement is defined, the program uses
- Legend statement for custom CLASS legend, e.g., LEGEND=LEGEND1
inflogis Influence plot for logistic regression models
powerrxc Power analysis for Chi-sqare tests of independence