VARIABLES Keyword (GGRAPH command)
The VARIABLES keyword identifies the variables, statistics, and utility function results that are included in the graph dataset. These are collectively identified as a variable specification. The minimum variable specification is a variable. An aggregation or summary function is required when the variable specification includes a multiple-response set. The order of the variables and functions in the variable specification does not matter. Multiple aggregation or summary functions are allowed so that you can graph more than one statistic. You can also use the ALL and TO keywords to include multiple variables without explicitly listing them. For information about the ALL keyword, see Keyword ALL. For information about the TO keyword, see Keyword TO.
When the variable specification includes an aggregation function and does not include the CASEVALUE function, the graph dataset is aggregated. Any stand-alone variables in the variable specification act as categorical break variables for the aggregation (including scale variables that are not parameters of a summary function). The function is evaluated for each unique value in each break variable. When the variable specification includes only variables or includes the CASEVALUE function, the graph dataset is unaggregated. The built-in variable $CASENUM is included in the unaggregated dataset. $CASENUM cannot be specified or renamed in the variable specification, but you can refer to it in the graph specification.
An unaggregated graph dataset includes a case for every case in the IBM® SPSS® Statistics dataset. An aggregated dataset includes a case for every combination of unique break variable values. For example, assume that there are two categorical variables that act as break variables. If there are three categories in one variable and two in the other, there are six cases in the aggregated graph dataset, as long as there are values for each category.
Note: If the dataset is aggregated, be sure to include all of the break variables in the graph specification (the ViZml or GPL). For example, if the variable specification includes two categorical variables and a summary function of a scale variable, the graph specification should use one of the categorical variables as the x-axis variable and one as a grouping or panel variable. Otherwise, the resulting graph will not be correct because it does not contain all of the information used for the aggregation.
Example
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat[NAME="empcat" LEVEL=NOMINAL] COUNT()
/GRAPHSPEC SOURCE=GPLFILE("simplebarchart.gpl").
- The NAME qualifier renames a variable. See the topic Variable and Function Names (GGRAPH command) for more information.
- The LEVEL qualifier specifies a temporary measurement level for a variable. See the topic Measurement Level (GGRAPH command) for more information.