Graphical methodsLinear modelsCategorical dataStructural equation modelsUtility macrosMy Books
Univariate displays
Bivariate displays
Multivariate displays
Cluster analysis
Maps
boxplot
density
dotplot
nqplot
splot
symbox
symplot
contour
ellipses
lowess
miplot
resline
sparkline
sunplot
surface
biplot
canplot
coplot
corrgram
cqplot
faces
genscat
hecan
hemat
hemreg
heplot
heplots
mpower
outlier
robcov
scatmat
scatter
stars
gtree
ccmap
map2gen
ANOVA
Regression
Multivariate
Transformations
Power
alleff
effplot
hovplot
meanplot
orpoly
poly
twoway
cpplot
effplot
partial
inflplot
robust
rsqdelta
hecan
hemat
hemreg
heplot
heplots
boxcox
boxglm
boxtid
sprdplot
fpower
mpower
power
rpower
Discrete distributions
Two-way tables
Mosaic displays
Generalized linear models
distplot
goodfit
ordplot
poisplot
rootgram
agree
agreeplot
corresp
ffold
fourfold
power2x2
powerrxc
sieve
sieveplot
missrc
genscat
mosaic
mosaics
mosmat
addvar
catplot
effplot
halfnorm
inflglim
inflogis
logodds
powerlog
robust
caliscmp
calisgfi
csmpower
eqs2ram
ram2dot
str2ram
Data utility
Graphics utility
Macro utility
Color
combine
combos
dummy
expgrid
interact
jitter
lags
map2gen
multisummary
mvnormal
sas2vsta
scale
slice
sort
stat2dat
table
axis
bars
boxanno
boxaxis
equate
gask
gbank
gdispla
genpat
gensym
gkill
gskip
inset
label
labels
lines
panels
points
polygons
pscale
regline
rug
expglm
defined
lastword
vexpand
words
bpycolors
brewerpal
colochrt
colorramp
SAS System for Statistical Graphics
Visualizing Categorical Data
Visual Statistics
gensym Macro to generate SYMBOL statement for each GROUP gensym

Visualizing Categorical Data: gensym

$Version: 1.2 (19 Jul 2001)
Michael Friendly
York University

The gensym macro ( [download] get gensym.sas)

Macro to generate SYMBOL statement for each GROUP

The GENSYM macro generates a series of SYMBOL statements for multiple group plots of the form

  proc gplot;
     plot y * x = group;

Separate plot symbols, colors, line styles and interpolation options may be generated for each group.

Usage

The GENSYM macro is called with keyword parameters. All parameters have default values, but the N= parameter must usually be specified. The arguments may be listed within parentheses in any order, separated by commas. For example:

  %gensym(n=4);

The INTERP=, LINE=, SYMBOLS=, and COLORS= parameters are each lists of one or more values. If fewer than N (blank delimited) values are given, the available values are reused cyclically as needed.

Parameters

N=
The number of groups. N= symbol statements are constructed, named SYMBOL1, SYMBOL2, ..., SYMBOLN.
H=
The height of the plotting symbol. The same H= value is used for all SYMBOL statements. [Default: H=1.5]
INTERP=
List of one or more interpolation options. [Default: INTERP=NONE]
LINE=
List of one or more numbers in the range 1..46 giving SAS/GRAPH line styles [Default: LINE=1]
SYMBOLS=
A list of one or more names of SAS/GRAPH plotting symbols. [Default: SYMBOLS=%STR(SQUARE TRIANGLE : $ = X _ Y)]
COLORS=
A list of one or more names of SAS/GRAPH colors. [Default: COLORS=BLACK RED GREEN BLUE BROWN YELLOW ORANGE PURPLE]

Example

To plot the four combinations of age group (old, young) and sex, with separate plotting symbols (circle, dot) for old vs. young, and separate colors (red, blue) for females vs. males, use the macro as follows:
  proc gplot;
     plot y * x = agesex;
     %gensym(n=4, symbols=circle circle dot dot, colors=red blue,
        interp=rl);

See also

gensymMacro to generate PATTERN statements
meanplot
scatmat

[Previous] [Next] [Up] [Contents] [Search]
Previous: gdispla Next: goodfit Up: Appendix A Top: index.html