This content describes Snap 11. For Snap 10, the equivalent page will be in Snap 10 help
A Numeric Function is used to quantify some aspect of a variable. All Numeric Functions have names, some of which have symbol equivalents. The symbol equivalents are shown immediately beneath the corresponding names in the following table.
To use a function with a variable, precede the variable name with the function name or symbol. For example, to obtain the number of responses to the variable called AGE use NUM AGE (or the equivalent using symbols: #AGE).
Note that if function names are used, at least one space must be left between the function and variable names. If function symbols are used the spacing is optional.
Table of numeric functions for use with numeric formulae
Function |
Description |
|---|---|
NUM # |
Gives the number of responses, by case, for the referenced variable. It is typically used with multiple response variables. For cases where the referenced variable is missing, i.e. with Error, Not Asked or No Reply values the result is 0. Single, quantity, date, time and literal variables will always give the result 1 unless they are Missing,. NUM also works with logical expressions. For example: NUM (Q1=1) gives 1 if true, and 0 if false. |
CODES |
Gives the number of codes of the referenced variable. Note this is not the number of responses (see NUM above) it is the number of codes defined and is therefore a constant for a given variable. If the referenced variable is a Quantity Response, Time Response, Date Response or Literal Response then the result is 1. |
MIN << |
Gives the number of the lowest code chosen as a response for the referenced variable. It is typically used with multiple response variables. For cases where the referenced variable is missing (i.e. with Error, Not Asked or No Reply values) the result is No Reply. Literal, quantity, date and time response variables will always give the result 1 unless they are Missing,. |
MAX >> |
Gives the number of the highest code chosen as a response for the referenced variable. It is typically used with multiple response variables. For cases where the referenced variable is missing, i.e. with Error, Not Asked or No Reply values, the result is No Reply. Unless they are Missing, literal, quantity and date response variables will always give the result 1. |
|
See Also |