Skip to content

High value Statements and Options

Shane Rosanbalm edited this page Mar 22, 2017 · 13 revisions

Contents

  1. High-value Plot Statements
  2. High-value Plot Options
  3. High-value Other Statements

There are over 30 different plot statements in SGPLOT, each with as many as 40 different options per plot type, not to mention the non-plot statements and their options. The volume of information can be overwhelming. This page attempts to identify the high-value statements and options. Familiarize yourself with this content first, and once you've got your head wrapped around this, then you can start poking around in the online documentation.

Credit: the below image were copied with permission from the excellent SGF 2015 paper Graphing Made Easy with SGPLOT and SGPANEL Procedures.

High-value Plot Statements

scatter SCATTER X=variable Y=variable / GROUP=variable;

series SERIES X=variable Y=variable / GROUP=variable;

step STEP X=variable Y=variable / GROUP=variable;

High-value Plot Options

To modify marker and line attributes for non-grouped data, use these options:

markerattrs MARKERATTRS=(COLOR=color SYMBOL=symbol SIZE=size)

lineattrs LINEATTRS=(COLOR=color PATTERN=pattern THICKNESS=thickness)

On the other hand, if you wish to group your data:

modstyle GROUP=variable

Then use the %modstyle macro to change your marker and line attributes.

%modstyle(markers=list of shapes, linestyles=list of patterns, colors=*list of colors", etc.);

High-value Other Statements

axes YAXIS LABEL="text" VALUE=(values) TYPE=type;

refline REFLINE variable|value / AXIS=X|Y;

keylegend KEYLEGEND / NOBORDER TITLE="text" LOCATION=inside|outside POSITION=bottom|bottomleft|...|topright;

Next page: Means over Time