VARIABLES subcommand (CROSSTABS command)

The VARIABLES subcommand is required for integer mode. VARIABLES specifies a list of variables to be used in the crosstabulations and the lowest and highest values for each variable. Values are specified in parentheses and must be integers. Non-integer values are truncated.

  • Variables can be specified in any order. However, the order in which they are named on VARIABLES determines their implied order on TABLES (see the TABLES subcommand below).
  • A range must be specified for each variable. If several variables can have the same range, it can be specified once after the last variable to which it applies.
  • CROSSTABS uses the specified ranges to allocate tables. One cell is allocated for each possible combination of values of the row and column variables before the data are read. Thus, if the specified ranges are larger than the actual ranges, workspace will be wasted.
  • Cases with values outside the specified range are considered missing and are not used in the computation of the table. This allows you to select a subset of values within CROSSTABS.
  • If the table is sparse because the variables do not have values throughout the specified range, consider using general mode or recoding the variables.

Example

CROSSTABS VARIABLES=FEAR SEX RACE (1,2) MOBILE16 (1,3)
   /TABLES=FEAR BY SEX MOBILE16 BY RACE.
  • VARIABLES defines values 1 and 2 for FEAR, SEX, and RACE and values 1, 2, and 3 for MOBILE16.