See Crunch Automation basics for more information.
Surveys often ask similar questions with identical response options about a number of things—ratings of items on a scale is a common example. There are many different terms for these: Radio Grids, Pick One-Multis, or Matrix-style-questions. The key element of the "grid" is that respondents can only select one response for each column (or row, depending on how it’s oriented).
In Crunch, this variable type is called a Categorical Array.
Sometimes, the metadata for Categorical Arrays are transferred on import, but often they are not. Any variable that is presented in a questionnaire in an array should be set up at a minimum as a Categorical Array (see this article for more information).
The CREATE CATEGORICAL ARRAY command takes a number of variables with identical categories (e.g., variables all with the same ordinal scale; but it could also be nominal data too) and derives a new array. It’s important to note that a new variable is created and the contributing variables are not eliminated (although you may wish to then hide them, as noted below).
Optional arguments
The LABELS argument is not optional. But you do have the option of whether you want to specify each label now as you create it, or borrow from the DESCRIPTIONS of the contributing variables.
The ALIASES option, if present, can be used to indicate the aliases that each of the subvariables of this new array will have. They all have to be unique across the dataset and match in quantity to the number of input variables for the array.
The HIDE INPUTS modifier is a handy way to move the contributing variables to the hidden folder. You generally do not need to refer to see the contributing variables in the variable sidebar again. Remember, you can still refer to contributing variables via their unique alias even if they are hidden.
CREATE CATEGORICAL ARRAY
alias, ..., alias
LABELS ("string", ..., "string"| COPY(DESCRIPTION)
[ALIASES alias, ..., alias]
[HIDE INPUTS]
AS alias
[TITLE "string"]
[DESCRIPTION "string"]
[NOTES "string"];
Use case
In the 2019 Mobile Technology and Broadband example datafile, there are many variables that belong in arrays, however, the metadata that defines the array is lost in storage in SPSS format.
The following four variables are meant to be grouped into a categorical array:
The following code creates a categorical array and conveniently hides the input variables (since these should be accessed by the viewer from the array):
CREATE CATEGORICAL ARRAY
sns2a, sns2b, sns2c, sns2d, sns2e
LABELS "Twitter", "Instagram", "Facebook", "Snapchat", "Youtube"
ALIASES sns2_cat_tw, sns2_cat_ig, sns2_cat_fb, sns2_cat_sc, sns2_cat_yt
HIDE INPUTS
AS sns2_cat
TITLE "Frequency of Social Media"
DESCRIPTION "Thinking about the social media sites you use... About how often do you visit or use....?";
In the above, the labels (brands) are declared explicitly because the descriptions of the variables contain unwanted information (the question wording). If the descriptions were just the brand names then one would use LABELS COPY(DESCRIPTION), as per the following:
CREATE CATEGORICAL ARRAY
sns2a, sns2b, sns2c, sns2d, sns2e
LABELS COPY(DESCRIPTION)
HIDE INPUTS
AS sns2_cat
TITLE "Frequency of Social Media"
DESCRIPTION "Thinking about the social media sites you use... About how often do you visit or use....?";