rug Create annotations for a rug plot along an axis rug

SAS Macro Programs: rug

$Version: 1.1-1 (10 Apr 2008)
Michael Friendly
York University


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

Create annotations for a rug plot along an axis

The RUG macro creates an annotate data set to draw 'rug lines' along an axis in a plot indicating the univariate distribution of a variable.

Usage

The RUG macro is defined with keyword parameters. The arguments may be listed within parentheses in any order, separated by commas. For example:

  %rug(data=foo, var=X1, at=0.05, out=rug1);
  proc gplot data=foo;
     plot Y * X1 / anno=rug1 ... ;

Parameters

DATA=
The name of the input data set [Default: DATA=_LAST_]
VAR=
Name of the variable for rug plot
BY=
Grouping variable: if specified, rugs are produced for each level of the BY= variable
CLASS=
Synonym for BY=
ON=
Axis on which to display the VAR values [Default: ON=X]
AT=
Location of bottom rug lines on axis, in percent coordinates. [Default: AT=0.5]
HT=
Height of rug lines, in percent coordinates. [Default: HT=2]
COLOR=
Color(s) of rug lines. A different color is used for each level of the CLASS= variable. [Default: COLOR=BLACK BLUE RED GREEN]
JITTER=
Amount of random jitter applied to the VAR= values. This is useful when the VAR= values are discrete, and would otherwise overplot. [Default: JITTER=0]
COPY=
The names of any variables to be copied to output dataset
IN=
The name of an optional input annotate data set. If specified, the IN= data set is concatenated with the OUT= data set.
OUT=
Name for output data set [Default: OUT=_RUG_]

Example

%include macros(rug);        *-- or include in an autocall library;

%rug();

See also

bars Create an annotate data set to draw error bars
label Create an Annotate dataset to label observations
points Create an Annotate dataset to draw points in a plot