CREATE CATEGORICAL ARRAY CASE command
See Crunch Automation basics for more information.
The CREATE CATEGORICAL ARRAY CASE command allows you to create a new array variable based on a number of conditions similar to a CASE variable.
Requirements
All expressions MUST evaluate to boolean conditions and all must result in arrays of the same number of subvariables as the input.
CREATE CATEGORICAL ARRAY CASE FROM alias,...,alias
WHEN expression THEN "label" CODE int [NUMERIC VALUE <float>] [MISSING]
...
WHEN expression THEN label" CODE int [NUMERIC VALUE <float>] [MISSING]
END
AS alias, ..., alias
[TITLE "string", ..., "string"| function]
[DESCRIPTION "string", ..., "string" | function]
[NOTES "string", ..., "string" | function];
Example
CREATE CATEGORICAL ARRAY CASE
FROM my_array1, my_array2
WHEN my_responses1 == 1 THEN "NA" CODE 13 MISSING
WHEN my_array2 == 3 THEN "Two" CODE 12
END
AS my_array_case1, my_array_case2;