Chapter 29: The GCHART Procedure


Overview

The GCHART procedure produces six types of charts: block charts, horizontal and vertical bar charts, pie and donut charts, and star charts. These charts graphically represent the value of a statistic calculated for one or more variables in an input SAS data set. The charted variables can be either numeric or character.

The procedure calculates these statistics:

  • frequency or cumulative frequency counts

  • percentages or cumulative percentages

  • sums

  • means.

Use the GCHART procedure to

  • display and compare exact and relative magnitudes

  • examine the contribution of parts to the whole

  • analyze where data are out of balance.

About Block Charts

Block charts display the relative magnitude of data with blocks of varying height, each set in a square that represents a category of data ( midpoint ). Because block charts do not use axes, they are most useful when the relative magnitude of the blocks is more significant than the exact magnitude of any particular block.

Figure 29.1 on page 774 shows a simple block chart of total sales for three manufacturing sites. Each site is a midpoint and occupies one square. The name of the site (the midpoint value) is printed below the square. Midpoint values are, by default, arranged in ascending order from left to right. The label below the midpoint grid names the chart variable.

click to expand
Figure 29.1: Block Chart (GCHBKSUM)

Sales for the site (the chart statistic) are represented by the height of the block; sales amount (the formatted statistic value) is printed below the block. The heading above the blocks describes the type of statistic, in this case SUM.

The program for this chart is in Example 1 on page 842. For more information on producing block charts, see BLOCK Statement on page 787.

About Bar Charts

Horizontal and vertical bar charts display the magnitude of data with bars, each of which represents a category of data (midpoint). The length (or height) of the bars represents the value of the chart statistic for the corresponding midpoint.

Figure 29.2 on page 775 shows a simple horizontal bar chart of total sales for three manufacturing sites. Each site is a midpoint and is displayed as a bar. The name of the site (the midpoint value) is printed on the midpoint axis beside the bar. Midpoint values are, by default, arranged in ascending order from top to bottom of the chart and labeled with the name of the chart variable.

click to expand
Figure 29.2: Horizontal Bar Chart (GCHBRSUM (a))

The chart statistics, in this case total sales for each site, are represented by the length of the bars. The response axis displays the scale of values for the chart statistic. The table of statistics to the right of the bars displays the exact statistic for each bar. Both a column in the table and the response axis are labeled with the name of the summary variable and the type of statistic.

The program for this chart is Example 3 on page 846.

Figure 29.3 on page 775 shows the same data presented as a vertical bar chart. The two types of bar charts have essentially the same characteristics, except that horizontal bar charts by default display a table of statistic values to the right of the bars, while vertical bar charts can optionally display the statistic value above or inside of each bar.

click to expand
Figure 29.3: Vertical Bar Chart (GCHBRSUM(b))

The program for this chart is Example 3 on page 846. For more information on producing horizontal and vertical bar charts, see HBAR, HBAR3D, VBAR, and VBAR3D Statements on page 796.

About Pie, Detail Pie, and Donut Charts

Pie and donut charts represent the relative contribution of parts to the whole by displaying data as wedge -shaped "slices" of a circle (either a "pie" or "donut"). Each slice represents a category of data (midpoint). The size of each slice (length of the arc) represents the contribution of the corresponding midpoint to the total chart statistic. Detail pie charts are pie charts with a second pie overlay that shows additional detail about the data that contributes to each of the outer pie s slices. Donut charts look like pie charts except that they have a hole in the middle in which you can place text.

Figure 29.4 on page 776 shows a pie chart of total sales for three manufacturing sites. Each site is a midpoint and is displayed as a slice. By default, the slices are ordered counterclockwise beginning at the 3 o clock position.

click to expand
Figure 29.4: Pie Chart (GCHPISUM(a))

Sales for the site (the chart statistic) are represented by the size of the slice. Both the sales amount (the formatted value of the chart statistic) and the name of the site (the midpoint value) are printed outside of the slice. You can also label pie slices with the percentage of the total statistic value that they represent. The heading above the pie describes the type of statistic (SUM), and names the summary variable (SALES) and the chart variable (SITE).

Figure 29.5 on page 776 show the three-dimensional version of the same pie chart.

click to expand
Figure 29.5: 3D Pie Chart (GCHPISUM(b))

Figure 29.6 on page 777 shows a detail pie chart generated from the same data.

click to expand
Figure 29.6: Detail Pie Chart (GCHDTPIE)

The programs for these charts are in Example 8 on page 869 and Example 15 on page 883. For more information on producing pie or donut charts, see PIE, PIE3D, and DONUT Statements on page 818.

About Star Charts

Star charts display data as lines ("spines") radiating from the center of a circle toward the perimeter. Each spine represents a category of data (midpoint). The length of a spine represents the magnitude of the chart statistic for that midpoint starting at the center of the circle, which by default represents 0. The radius of the circle is the length of the longest spine (greatest statistic value) in the chart. Instead of spines, star charts can also display the chart statistic as slices, which are enclosed areas formed by connecting the ends of the spines.

Figure 29.7 on page 777 shows the total sales for the three manufacturing sites as a star chart. Each site is a midpoint and is displayed as a spine. By default the ends of the spines are connected and they are ordered counterclockwise beginning at the 3 o'clock position.

click to expand
Figure 29.7: Star Chart (GCHSTSUM)

Sales for the site (the chart statistic) are represented by the length of the spine. Both the sales amount (the formatted statistic value) and the name of the site (the midpoint value) are printed outside of the star chart. You can also label star charts with the percentage of the total statistic value that they represent. The heading above the chart describes the type of statistic (SUM), and names the summary variable (SALES) and the chart variable (SITE).

The program for this chart is Example 13 on page 879. For more information on producing star charts, see STAR Statement on page 833.




SAS.GRAPH 9.1 Reference, Volumes I and II
SAS.GRAPH 9.1 Reference, Volumes I and II
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 342

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net