CHART Procedure

STAR Statement

Produces a star chart.

Syntax

Required Argument

variable(s)
specifies the variables for which PROC CHART produces a star chart, one chart for each variable.

Optional Arguments

AXIS=value-expression
specifies the values for the response axis, where value-expression is a list of individual values, each separated by a space, or a range with a uniform interval for the values. For example, the following range specifies tick marks on a bar chart from 0 to 100 at intervals of 10: hbar x / axis=0 to 100 by 10;
Restrictions:Values must be uniformly spaced, even if you specify them individually.

For frequency charts, values must be integers.

Interactions: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, then PROC CHART uses the minimum and maximum values from the list.

If you use AXIS= and the BY statement, then PROC CHART produces uniform axes over BY groups.

CAUTION:
Values in value-expression override the range of the data.
For example, if the data range is 1 to 10 and you specify a range of 3 to 5, then only the data in the range 3 to 5 appears on the chart. Values out of range produce a warning message in the SAS log.
FREQ=variable
specifies a data set variable that represents a frequency count for each observation. Normally, each observation contributes a value of one to the frequency counts. With FREQ=, each observation contributes its value of the FREQ= value.
Restriction:If the FREQ= values are not integers, then PROC CHART truncates them.
Interaction:If you use SUMVAR=, then PROC CHART multiplies the sums by the FREQ= value.
LEVELS=number-of-midpoints
specifies the number of bars that represent each chart variable when the variables are continuous.
MIDPOINTS=midpoint-specification | OLD
defines the range of values that each bar, block, or section represents by specifying the range midpoints.
The value for MIDPOINTS= is one of the following:
midpoint-specification
specifies midpoints, either individually, or across a range at a uniform interval. For example, the following statement produces a chart with five bars. The first bar represents the range of values of X with a midpoint of 10. The second bar represents the range with a midpoint of 20, and so on:
   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;
Example:
OLD
specifies an algorithm that PROC CHART used in previous versions of SAS to choose midpoints for continuous variables. The old algorithm was based on the work of Nelder (1976). The current algorithm that PROC CHART uses if you omit OLD is based on the work of Terrell and Scott (1985).
Default:Without MIDPOINTS=, PROC CHART displays the values in the SAS System's normal sorted order.
MISSING
specifies that missing values are valid levels for the chart variable.
NOHEADER
suppresses the default header line printed at the top of a chart.
Alias:NOHEADING
SUMVAR=variable
specifies the variable for which either values or means (depending on the value of TYPE=) PROC CHART displays in the chart.
Interaction:If you use SUMVAR= and you use TYPE= with a value other than MEAN or SUM, then 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.
TYPE=statistic
specifies what the bars or sections in the chart represent. The statistic is one of the following:
CFREQ
specifies that each bar, block, or section represent the cumulative frequency.
CPERCENT
specifies that each bar, block, or section represent the cumulative percentage.
Alias:CPCT
FREQ
specifies that each bar, block, or section represent the frequency with which a value or range occurs for the chart variable in the data.
MEAN
specifies that each bar, block, or section represent the mean of the SUMVAR= variable across all observations that belong to that bar, block, or section.
Interaction:With TYPE=MEAN, you can compute only MEAN and FREQ statistics.
PERCENT
specifies that each bar, block, or section represent the percentage of observations that have a given value or that fall into a given range of the chart variable.
SUM
specifies that each bar, block, or section represent the sum of the SUMVAR= variable for the observations that correspond to each bar, block, or section.
Default:FREQ (unless you use SUMVAR=, which causes a default of SUM)
Interaction:With TYPE=SUM, you can compute only SUM and FREQ statistics.

Details

Statement Results

The number of points in the star is determined in the same way as the number of bars for vertical bar charts.
If all the data values are positive, then the center of the star represents zero and the outside circle represents the maximum value. If any data values are negative, then the center represents the minimum. See the description of the AXIS=value expression for more information about how to specify maximum and minimum values. For information about how to specify the proportion of the chart, see the description of the LPI=value.
If you try to create a star chart for a variable with more than 24 levels, then PROC CHART produces a horizontal bar chart instead.