Chapter Contents |
Previous |
Next |
The CHART Procedure |
Many options in PROC CHART are valid in more than one statement. This section describes the options that you can use on the chart-producing statements.
To do this | Use this option | |
---|---|---|
Specify that numeric variables are discrete | DISCRETE | |
Specify a frequency variable | FREQ= | |
Specify that missing values are valid levels | MISSING | |
Specify the variable for which values or means are displayed | SUMVAR= | |
Specify the statistic represented in the chart | TYPE= | |
Specify groupings | ||
Group the bars in side-by-side charts | GROUP= | |
Specify that group percentages sum to 100 | G100 | |
Group the bars in side-by-side charts | GROUP= | |
Specify the number of bars for continuous variables | LEVELS= | |
Define ranges for continuous variables | MIDPOINTS= | |
Divide the bars into categories | SUBGROUP= | |
Compute statistics | ||
Compute the cumulative frequency for each bar | CFREQ | |
Compute the cumulative percentage for each bar | CPERCENT | |
Compute the frequency for each bar | FREQ | |
Compute the mean of the observations for each bar | MEAN | |
Compute the percentage of total observations for each bar | PERCENT | |
Compute the total number of observations for each bar | SUM | |
Control output format | ||
Print the bars in ascending order of size | ASCENDING | |
Specify the values for the response axis | AXIS= | |
Print the bars in descending order of size | DESCENDING | |
Specify extra space between groups of bars | GSPACE= | |
Suppress the default header line | NOHEADER | |
Allow no space between vertical bars | NOSPACE | |
Suppress the statistics | NOSTATS | |
Suppress the subgroup legend or symbol table | NOSYMBOL | |
Suppress the bars with zero frequency | NOZEROS | |
Draw reference lines | REF= | |
Specify the spaces between bars | SPACE= | |
Specify the symbols within bars or blocks | SYMBOL= | |
Specify the width of bars | WIDTH= |
Options |
Alias: | ASC |
Restriction: | Available only on the HBAR and VBAR statements |
hbar x / axis=0 to 100 by 10;
Restriction: | Not available on the PIE statement |
Restriction: | Values must be uniformly spaced, even if you specify them individually. |
Restriction: | For frequency charts, values must be integers. |
Interaction: | For BLOCK charts, AXIS= sets the scale of the tallest block. To set the scale, PROC CHART uses the maximum value from the AXIS= list. If no value is greater than 0, PROC CHART ignores the AXIS= option. |
Interaction: | For HBAR and VBAR charts, AXIS= determines tick marks on the response axis. If the AXIS= specification contains only one value, the value determines the minimum tick mark if the value is less than 0, or determines the maximum tick mark if the value is greater than 0. |
Interaction: | For STAR charts, a single AXIS= value sets the minimum (the center of the chart) if the value is less than zero, or sets the maximum (the outside circle) if the value is greater than zero. If the AXIS= specification contains more than one value, PROC CHART uses the minimum and maximum values from the list. |
Interaction: | If you use AXIS= and the BY statement, PROC CHART produces uniform axes over BY groups. |
Restriction: | Available only on the HBAR statement |
Restriction: | Available only on the HBAR statement |
Alias: | DESC |
Restriction: | Available only on the HBAR and VBAR statements |
Restriction: | Available only on the HBAR statement |
Restriction: | If the FREQ= values are not integers, PROC CHART truncates them. |
Interaction: | If you use SUMVAR=, PROC CHART multiplies the sums by the FREQ= value. |
vbar gender / group=dept;
Missing values for a GROUP= variable are treated as valid levels.
Restriction: | Available only on the BLOCK, HBAR, and VBAR statements |
Featured in: | Producing Side-by-Side Bar Charts , Producing a Horizontal Bar Chart for a Subset of the Data , Producing Block Charts for BY Groups |
Restriction: | Available only on the HBAR and VBAR statements |
Interaction: | PROC CHART ignores GSPACE= if you omit GROUP= |
Restriction: | Available only on the BLOCK, HBAR, and VBAR statements |
Interaction: | PROC CHART ignores G100 if you omit GROUP=. |
Restriction: | Available only on the HBAR statement and only when you use SUMVAR= and TYPE= |
Restriction: | Not available when TYPE=CFREQ, CPERCENT, FREQ, or PERCENT |
The value for MIDPOINTS= is one of the following:
vbar x / midpoints=10 20 30 40 50;
Here is an example of a midpoint specification for a character variable:
vbar x / midpoints='JAN' 'FEB' 'MAR';
Here is an example of specifying midpoints across a range at a uniform interval:
vbar x / midpoints=10 to 100 by 5;
Default: | Without MIDPOINTS=, PROC CHART displays the values in the SAS System's normal sorted order. |
Restriction: | When the VBAR variables are numeric, the midpoints must be given in ascending order. |
Alias: | NOHEADING |
Restriction: | Available only on the BLOCK, PIE, and STAR statements |
Featured in: | Producing Block Charts for BY Groups |
Alias: | NOSTAT |
Restriction: | Available only on the HBAR statement |
Alias: | NOLEGEND |
Restriction: | Available only on the BLOCK, HBAR, and VBAR statements |
Interaction: | PROC CHART ignores NOSYMBOL if you omit SUBGROUP=. |
Restriction: | Available only on the HBAR and VBAR statements |
Restriction: | Available only on the HBAR statement |
Restriction: | Available only on the HBAR and VBAR statements |
Tip: | The REF= values should correspond to values of the TYPE= statistic. |
Featured in: | Producing Side-by-Side Bar Charts |
Restriction: | Available only on the HBAR and VBAR statements |
Tip: | Use SPACE=0 to leave no space between adjacent bars. |
Tip: | Use the GSPACE= option to specify the amount of space between the bars within each group. |
The characters used in the chart and the values that they represent are given in a legend at the bottom of the chart. The subgroup symbols are ordered A through Z and 0 through 9 with the characters in ascending order.
PROC CHART calculates the height of a bar or block for each subgroup individually and then rounds the percentage of the total bar up or down. So the total height of the bar may be higher or lower than the same bar without the SUBGROUP= option.
Restriction: | Available only on the BLOCK, HBAR, and VBAR statements |
Interaction: | If you use both TYPE=MEAN and SUBGROUP=, PROC CHART first calculates the mean for each variable listed in the SUMVAR= option, then subdivides the bar into the percentages contributed by each subgroup. |
Featured in: | Subdividing the Bars into Categories |
Restriction: | Available only on the HBAR statement and only when you use both SUMVAR= and TYPE= |
Restriction: | Not available when TYPE=CFREQ, CPERCENT, FREQ, or PERCENT |
Interaction: | If you use SUMVAR= and you use TYPE= with a value other than MEAN or SUM, TYPE=SUM overrides the specified TYPE= value. |
Tip: | Both HBAR and VBAR charts can print labels for SUMVAR= variables if you use a LABEL statement. |
Featured in: | Subdividing the Bars into Categories , Producing Side-by-Side Bar Charts , Producing a Horizontal Bar Chart for a Subset of the Data , Producing Block Charts for BY Groups |
Default: | asterisk (*) |
Restriction: | Available only on the BLOCK, HBAR, and VBAR statements |
Interaction: | If the SAS system option OVP is in effect and if your printing device supports overprinting, you can specify up to three characters to produce overprinted charts. |
Featured in: | Producing Block Charts for BY Groups |
Alias: | CPCT |
Interaction: | With TYPE=MEAN, you can only compute MEAN and FREQ statistics. |
Featured in: | Producing Side-by-Side Bar Charts |
Alias: | PCT |
Featured in: | Producing a Percentage Bar Chart |
Default: | FREQ (unless you use SUMVAR=, which causes a default of SUM) |
Interaction: | With TYPE=SUM, you can only compute SUM and FREQ statistics. |
Restriction: | Available only on the HBAR and VBAR statements |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.