CREATE NUMERIC TALLY command
See Crunch Automation basics for more information.
The CREATE NUMERIC TALLY command creates a new numeric variable that counts how many categories of a multiple response variable were selected for each row. All input variables must be of the multiple_response type.
To compute the tally of a subset, first create a multiple response variable containing only the items you wish to tally.
- The EXCEPT block takes either a list of aliases (unquoted or using backticks if required) or a list of labels (quoted strings).
- The VALID | MISSING expression allows you to define the result of a missing mask. By default, it takes MISSING all_missing(input_var).
CREATE NUMERIC TALLY alias
[EXCEPT alias, ... , alias (or) "string", ... , "string"]
[ALL VALID | (VALID | MISSING expression)]
AS alias
[TITLE "string"]
[DESCRIPTION "string" | COPY]
[NOTES "string" | COPY];
Example
CREATE NUMERIC TALLY watched_dramas
EXCEPT none_of_these
MISSING is_missing(watched_dramas)
AS num_watched_dramas
TITLE "Number of drama shows watched",
DESCRIPTION "Computed from Drama shows watched";