SGPLOT Procedure

Example 1: Grouping a Scatter Plot

Features:

SCATTER statement

Sample library member: SGPLSCT
This example shows a simple scatter plot with grouped data.

Output

SGPLSCT - Grouping a Scatter Plot

Program

proc sgplot data=sashelp.class;
  scatter x=height y=weight / group=sex;
run;

Program Description

Create the scatter plot. In the SCATTER statement, the GROUP= option groups the data by the SEX variable.
proc sgplot data=sashelp.class;
  scatter x=height y=weight / group=sex;
run;