does not always correspond to an actual value of the chart variable. The size of each bar,
block, or section represents the number of observations that fall in that range.
PROC CHART makes several types of charts:
vertical and horizontal bar charts
display the magnitude of data with the length or height of bars.
display the relative magnitude of data with blocks of varying size.
display data as wedge-shaped sections of a circle that represent the relative
contribution of each section to the whole circle.
display data as bars that radiate from a center point, like spokes in a wheel.
The shape of each type of chart emphasizes a certain aspect of the data. The chart that
you choose depends on the nature of your data and the aspect that you want to
Creating Vertical Bar Charts
Understanding Vertical Bar Charts
A vertical bar chart emphasizes individual ranges. The horizontal, or midpoint, axis
shows the values of the variable divided into ranges. By default, the vertical axis shows
the frequency of values for a given range. The differences in bar heights enable you to
quickly determine which ranges contain many observations and which contain few
The VBAR statement in a PROC CHART step produces vertical bar charts. If you use
the VBAR statement without any options, then PROC CHART automatically does the
• scales the vertical axis
• determines the bar width
• selects the spacing between bars
• labels the axes
For continuous numeric data, PROC CHART determines the number of bars and the
midpoint for each bar from the minimum and maximum value of the chart variable. For
character variables or discrete numeric variables, PROC CHART creates a bar for each
value of the chart variable. However, you can change how PROC CHART determines
the axes by using options.
Note: If the number of characters per line (LINESIZE=) is not sufficient to display
vertical bars, then PROC CHART automatically produces a horizontal bar chart.
The following program uses the VBAR statement to create a vertical bar chart of
frequencies for the numeric variable ExamGrade1:
options pagesize=40 linesize=80 pageno=1 nodate;
proc chart data=grades;
title 'Grades for First Chemistry Exam';
556 Chapter 31 • Producing Charts to Summarize Variables