Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Creating Graphs

Example: Create a 3-D Bar Chart

Open the Fitness Data Set

In this example, you create a bar chart using the Fitness data set. To open the Fitness data set, follow these steps:

  1. Select Tools arrow Sample Data ...
  2. Select Fitness.
  3. Click OK to create the sample data set in your Sasuser directory.
  4. Select File arrow Open By SAS Name ...
  5. Select Sasuser from the list of Libraries.
  6. Select Fitness from the list of members.
  7. Click OK to bring the Fitness data set into the data table.

Specify Chart and Grouping Variables

To create a 3-D vertical bar chart that compares among experimental groups the average amount of oxygen consumed given the time it takes to run 1.5 miles, follow these steps:

  1. Select Graphs arrow Bar Chart arrow Vertical ... to display the Vertical Bar Chart dialog.
  2. Select runtime from the candidate list, and click Chart to make minutes to run 1.5 miles the charted variable.
  3. Under Bar type, select 3-D to make the bar chart three-dimensional.
  4. To compare among experimental groups, select group from the candidate list and click Group By.

    c0509.gif (6230 bytes)

    Figure 5.9: Chart and Grouping Variables

Specify Bar Chart Options

To specify your bar chart options, such as the number and appearance of the bars, follow these steps.

  1. Click on the Options button to display the Bar Chart Options dialog.
  2. Under Number of bars, select N bars, and click on the down arrow until N = 3. Because a grouping variable was specified, bars for three runtime midpoints are displayed for each value of the experimental group.

    c0510.gif (7026 bytes)

    Figure 5.10: Number of Bars

  3. Select the Bar Values tab. Under Analysis variables, select oxygen from the candidate list and click on the Analysis button to make oxygen consumption your analysis variable.
  4. Under Statistic to chart, select Average to display the average oxygen consumption per runtime.

    c0511.gif (8303 bytes)

    Figure 5.11: Bar Values

  5. Select the Appearance tab. Under Bar outline, click on the Color button. Select White from the Color Attributes list to make the bar outlines white.

    c0512.gif (6178 bytes)

    Figure 5.12: Bar Outlines

    Click OK to close the Color Attributes window and return to the Bar Chart Options dialog.

  6. Still on the Appearance tab, select Group variable value under Change bar appearance with change in.

    c0513.gif (8254 bytes)

    Figure 5.13: Bar Appearance

  7. Click OK to return to the Vertical Bar Chart dialog.

Specify Bar Chart Titles

To specify the titles for your bar chart, follow these steps:

  1. Click on the Titles button in the Vertical Bar Chart dialog.
  2. In the Bar Chart tab, type Runtime and Oxygen Consumed in the first field.

    c0514.gif (4081 bytes)

    Figure 5.14: Bar Chart Title

  3. Click on the Global tab. Type Fitness Report in the first field. This global title is saved across all Analyst sessions until you change it.

    c0515.gif (3705 bytes)

    Figure 5.15: Global Title

  4. Click OK to save your title changes.

Generate Bar Chart

To display your bar chart, click OK in the Vertical Bar Chart dialog.

c0516.gif (22439 bytes)

Figure 5.16: Vertical Bar Chart

As expected, larger amounts of oxygen are consumed by faster runners. Experimental group does not appear to affect this relationship or the average amount of oxygen consumed. No members of experimental group 2 were among the slowest runners.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.