SGPANEL Procedure

Example 2: Creating a Panel of Regression Curves

Features:

REG statement

Sample library member: SGPNREG
This example shows a panel of regression curves. The COLUMNS= option in the PANELBY statement specifies that the panel has three columns of graph cells.

Output

Panel of Regression Curves

Program

proc sgpanel data=sashelp.iris;
  title "Scatter plot for Fisher iris data";
  panelby species / columns=3;
 
 reg x=sepallength y=sepalwidth / cli clm;
run;
title;

Program Description

Create the panel and specify the title.
proc sgpanel data=sashelp.iris;
  title "Scatter plot for Fisher iris data";
Specify the classification variable for the panel. The COLUMNS= option specifies the number of columns in the panel.
  panelby species / columns=3;
 
Create the regression curve. The CLI option creates individual predicted value confidence limits. The CLM option creates mean value confidence limits.
 reg x=sepallength y=sepalwidth / cli clm;
run;
Cancel the title.
title;