|Doing More with SAS/ASSIST Software|
You can use
Bar Charts on the Graphics menu
to create horizontal or vertical simple bar charts, stacked bar charts, grouped
bar charts, and grouped and stacked bar charts. In the "Graphics"
Getting Started with the SAS System Using SAS/ASSIST Software, you learned how to create a bar chart. This section
describes some of the more advanced options available when generating bar
|Generating a Bar Chart with the Mean Displayed|
In this section you create a vertical bar chart showing the
mean weight by age in the CLASS data set. You choose to have the mean of
each bar displayed above the bar, adjust the fill patterns of the bars, add
a title to the chart, and change the font of the title.
Bar Charts Window
Bar/Slice Values Window
General Options Window
Color and Pattern Options Window
For the 2ND and 5TH areas, leave the pattern as Solid.
For the 3RD and 6TH areas, select Empty as the pattern.
The pattern selected by default for the bars is Solid. If you print a black and white graphic as shown in this book, you can use the pattern options to distinguish one bar from another.
If you print a color graphic, you can use colors to
distinguish one bar from another. To display a list of valid colors, type
? in the first position of the Color field and press ENTER. Select the color
you want to use.
Midpoint Values Window
You select Use each discrete chart variable value to display one bar for each age represented in the CLASS data set (11, 12, 13, 14, 15, and 16). The default for the number of bars is Let the number of midpoints default, which lets the procedure determine the number of midpoints (bars) for the chart column. Each midpoint represents a median of a range of values. In this example, if you use Let the number of midpoints default, the bars represent the midpoints of the AGE variable (11.4, 12.6, 13.8, 15, and 16.2).
The window that appears when you select Number of bars is different for numeric and character chart columns.
Title 1 Window
Mean Weight by Ageas the title for the plot.
Note: Titles carry over from one report or graphic to
another. If you do not type a title and a title was selected previously in
the current SAS/ASSIST session, the previous title automatically appears on
The Font List window appears.
Font List Window
Select OK twice to return to the Bar Charts window.
Bar Chart Output
|Other Bar Chart Options|
By selecting 3D in the Bar Charts window, you can create three-dimensional bar charts, as shown in the following example.
Three-dimensional Bar Chart Output
By assigning a column to Stacking column or Grouping column, you can create bar charts that show more interesting relationship in your data. For example, if you assign the SEX column to Grouping column in the previous example, you create a bar graph that separates the data for males and females:
Grouped Bar Chart Output
Similarly, if you assign the SEX column to Stacking column and use frequency for Bar values, you can create a bar chart with males and females distinguished in the same bar for each age:
Stacked Bar Chart Output
You can also
combine stacking and grouping to create
grouped stacked bar charts.
By selecting Horizontal on the Bar Charts window, you can create bar charts with the bars running horizontally rather than vertically. Grouping and stacking options are also available for horizontal bar charts. Instead of being able to display a particular statistic for each bar (as in the vertical bar chart example earlier in this section), you can select Display statistics on the General Options window, which causes statistics to be displayed to the right of the bar chart.
Horizontal Bar Chart Output
By choosing items on the Additional Options menu, you can add a reference line to your bar chart; change the color, size, and font of the label text; change the appearance of the axes; and change the appearance of the legend.
Top of Page
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.