SGPLOT Procedure

Example 9: Creating a Horizontal Box Plot

Features:

HBOX statement

Sample library member: SGPLBOX
This example shows a horizontal box plot.

Output

SGPLBOX - Creating a Box Plot

Program

proc sgplot data=sashelp.heart;
  title "Cholesterol Distribution by Weight Class";
  hbox cholesterol / category=weight_status;
run;
title;

Program Description

Create the box plot. The CATEGORY= option specifies the category variable.
proc sgplot data=sashelp.heart;
  title "Cholesterol Distribution by Weight Class";
  hbox cholesterol / category=weight_status;
run;
title;