Overview (MISSING VALUES command)

MISSING VALUES declares values user-missing. These values can then receive special treatment in data transformations, statistical calculations, and case selection. By default, user-missing values are treated the same as the system-missing values. System-missing values are automatically assigned by the program when no legal value can be produced, such as when an alphabetical character is encountered in the data for a numeric variable, or when an illegal calculation, such as division by 0, is requested in a data transformation.

Basic Specification

The basic specification is a single variable followed by the user-missing value or values in parentheses. Each specified value for the variable is treated as user-missing for any analysis.

Syntax Rules

  • Each variable can have a maximum of three individual user-missing values. A space or comma must separate each value. For numeric variables, you can also specify a range of missing values. See the topic Specifying Ranges of Missing Values (MISSING VALUES command) for more information.
  • The missing-value specification must correspond to the variable type (numeric or string).
  • The same values can be declared missing for more than one variable by specifying a variable list followed by the values in parentheses. Variable lists must have either all numeric or all string variables.
  • Different values can be declared missing for different variables by specifying separate values for each variable. An optional slash can be used to separate specifications.
  • Missing values for string variables must be enclosed in single or double quotes. The value specifications must include any leading blanks. See the topic String Values in Command Specifications for more information.
  • For date format variables (for example, DATE, ADATE), missing values expressed in date formats must be enclosed in single or double quotes, and values must be expressed in the same date format as the defined date format for the variable.
  • A variable list followed by an empty set of parentheses ( ) deletes any user-missing specifications for those variables.
  • The keyword ALL can be used to refer to all user-defined variables in the active dataset, provided the variables are either all numeric or all string. ALL can refer to both numeric and string variables if it is followed by an empty set of parentheses. This will delete all user-missing specifications in the active dataset.
  • More than one MISSING VALUES command can be specified per session.

Operations

  • Unlike most transformations, MISSING VALUES takes effect as soon as it is encountered. Special attention should be paid to its position among commands. See the topic Command Order for more information.
  • Missing-value specifications can be changed between procedures. New specifications replace previous ones. If a variable is mentioned more than once on one or more MISSING VALUES commands before a procedure, only the last specification is used.
  • Missing-value specifications are saved in IBM® SPSS® Statistics data files (see SAVE) and portable files (see EXPORT).

Limitations

Missing values for string variables cannot exceed 8 bytes. (There is no limit on the defined width of the string variable, but defined missing values cannot exceed 8 bytes.)