SGSCATTER Procedure

Example 2: Creating a Graph with Multiple Independent Scatter Plots and Spline Curves

Features:

PLOT statement

PBSPLINE option

Sample library member: SGSCPLT
This example shows a graph with multiple independent scatter plots with fitted splines.

Output

Multiple Scatter Plots and Spline Curves

Program

proc sgscatter data=sashelp.iris(where=(species="Virginica"));
  title "Multi-Celled Spline Curve for Species Virginica";
  plot (sepallength sepalwidth)*(petallength petalwidth)
       / pbspline;
run;
title;

Program Description

Create the scatter plots. In the PLOT statement, the PBSPLINE option fits the spline curves to the scatter points.
proc sgscatter data=sashelp.iris(where=(species="Virginica"));
  title "Multi-Celled Spline Curve for Species Virginica";
  plot (sepallength sepalwidth)*(petallength petalwidth)
       / pbspline;
run;
title;