Macro Programs from "The SAS System for Statistical Graphics"
The SAS System for Statistical Graphics, First Edition contains numerous general macro programs for the graphical methods described in the book. These
programs are described and illustrated throughout the book and listed in Appendix A. The book may be ordered by WWW (click for an order form) from
SAS Institute .
Copyright: Yes, Warrantee: No
These programs all bear the following copyright notice:
From SAS System for Statistical Graphics, First Edition;
Copyright(c) 1991 by SAS Institute Inc., Cary, NC, USA.
This material is provided "as is" by SAS Institute Inc. There
are no warranties, express or implied, as to merchantability or
fitness for a particular purpose regarding the materials or code
contained herein. The Institute is not responsible for errors
in this material as it now exists or will exist, nor does the
Institute provide technical support for it. Questions or
problem reports concerning this material may be addressed to the
author, Michael Friendly, by electronic mail:
Michael Friendly <email@example.com>
The graphic macros published in Appendix A of SAS System for
Statistical Graphics are available from several sources.
The original versions of the programs (if you should want them)
may be obtained by anonymous ftp from
FTP.SAS.COM. Login as user ANONYMOUS, change to the proper
directory with the command:
and use the get command to retrieve
the file statgraf.sas (204K)
or the file statgraf.zip (64K).
The file graphmac.doc contains some
basic documentation on the macros, but it is assumed you have
the book, which gives numerous examples of their use.
Note that some of the macros are maintained in two versions
to account for some differences among SAS versions and
The current versions of the programs may also be obtained from
where the current versions are maintained.
To obtain the programs individually by WWW, click the icons below.
The datasets used in the book are also available here in the
Click the program name for program documentation, or the button to obtain the program. See the Usage Notes for local modifications you may have to make at your site and for general descriptions of macro parameter conventions.
- Implements the biplot technique (e.g., Gabriel, 1971)
for plotting multivariate observations and variables together
in a single display.
- Provides univariate
marginal boxplot annotations for two-dimensional
and three-dimensional scatterplots.
- Produces standard and notched boxplots
for a single response variable with one or more grouping variables.
- Plots a bivariate scatterplot with a bivariate
data ellipse for one or more groups with one or more confidence
- Performs correspondence analysis (also known as "dual scaling")
on a table of frequencies in a
two-way (or higher-way) classification.
In V6 of SAS., this analysis is also performed by PROC CORRESP.
- Calculates a nonparametric density estimate
for histogram smoothing of a univariate data distribution.
The program uses the Gaussian kernel and calculates an optimal
window half-width (Silverman, 1986) if not specified by the user.
- Produces grouped and ungrouped dot charts of a single variable
(Cleveland, 1984, 1985).
- Performs robust, locally weighted scatterplot smoothing
- Produces theoretical normal quantile-quantile
(Q-Q) plots for single variable.
Options provide a classical (mu, sigma) or
robust (median, IQR) comparison line, standard error envelope,
and a detrended plot.
- Detects multivariate outliers.
The OUTLIER macro calculates
robust Mahalanobis distances by iterative multivariate trimming
(Gnanadesikan & Kettenring, 1972; Gnanadesikan, 1977),
and produces a chisquare Q-Q plot.
- Produces partial regression residual plots.
Observations with high leverage and/or large studentized
residuals can be individually labeled.
- Draws a scatterplot matrix for all pairs of
A classification variable may be used to assign the plotting symbol
and/or color of each point.
- Draws a star plot of the multivariate observations
in a data set.
Each observation is depicted by a star-shaped figure with one ray
for each variable, whose length is proportional to the size of
- Produces a variety of diagnostic
plots for assessing symmetry of a data distribution and
finding a power transformation to make the data more symmetric.
- Performs an exploratory
analysis of two-way experimental design data with one observation
per cell, including Tukey's (1949)
one degree of freedom test for non-additivity.
Two plots may be produced: a
graphical display of the fit and residuals for
the additive model, and a
diagnostic plot for a power transformation for
friendly AT yorku DOTca
My home page