SGPANEL Procedure

Example 1: Creating a Panel of Graph Cells with Histograms and Density Plots

Features:

HISTOGRAM statement

DENSITY statement

Sample library member: SGPNHST
This example shows a panel of graph cells with histograms and density plots.

Output

Panel of Histograms

Program

proc sgpanel data=sashelp.heart noautolegend;
  title "Cholesterol Distribution in Heart Study";
  panelby sex;
  histogram cholesterol;
  density cholesterol;
run;
title;

Program Description

Create the panel and specify the title.
proc sgpanel data=sashelp.heart noautolegend;
  title "Cholesterol Distribution in Heart Study";
Specify the classification variable for the panel.
  panelby sex;
Create the histogram and density plots.
  histogram cholesterol;
  density cholesterol;
run;
Cancel the title.
title;