The CREATE MULTIPLE DICHOTOMY FROM <text> command allows you to apply a taxonomy to a text (open-ended) variable. Crunch reads each response, classifies it to matching categories of the taxonomy and saves the result as a new variable. This command can select several categories for the same response. Use this command when one answer can mention more than one topic.
The taxonomy can be defined with the DEFINE TAXONOMY command earlier in the same script, or in a previous one, or one created in Crunch UI. The taxonomy must belong to the same project (folder) as the dataset.
Important to remember:
- The input variable must be a text variable.
- The output alias must not exist in the dataset yet.
The following argument is optional:
- WHERE - a condition that allows you to categorize only some of the responses of an open ended variable. Specifically, the responses in the rows that match a condition. Conditions that can be used with WHERE include:
- ==, <, >, and <=, for example: age >= 18 or wave == "Wave 3"
- IN with a list, for example: region IN ["North", "South"]
- is_missing(), for example: is_missing(issue_coded)
- AND, OR, NOT to combine conditions, for example: age >= 18 and not (region == "North")
CREATE MATERIAL MULTIPLE DICHOTOMY FROM <text variable alias>
WHERE condition
USING "taxonomy name"
AS <alias for output variable>
TITLE "title for output variable";Example
CREATE MATERIAL MULTIPLE DICHOTOMY FROM <most_important_issue>
WHERE wave == "Wave 3"
USING "Created from most_important (2)"
AS most_important_mr
TITLE "Most Important Issues (MR)";The multiple response variable has one category per category of the taxonomy, plus:
- Unclassified – responses that don't match any category of the taxonomy.
- No data – cases with no responses (missing).
REPLACE MULTIPLE DICHOTOMY FROM <text>
The REPLACE MULTIPLE DICHOTOMY FROM <text> command allows you to categorize additional text responses to an existing categorized variable. The properties of the categorized variable do not change, the new text responses are added to the categories of the variable.
The following argument is optional:
- WHERE - a condition that allows you to categorize only some of the responses of an open ended variable. Specifically, the responses in the rows that match a condition. Conditions that can be used with WHERE include:
- ==, <, >, and <=, for example: age >= 18 or wave == "Wave 3"
- IN with a list, for example: region IN ["North", "South"]
- is_missing(), for example: is_missing(issue_coded)
- AND, OR, NOT to combine conditions, for example: age >= 18 and not (region == "North")
REPLACE MATERIAL MULTIPLE DICHOTOMY alias FROM <text variable alias>
WHERE condition
ELSE VARIABLE <alias>
USING "taxonomy name"; Example
REPLACE MATERIAL MULTIPLE DICHOTOMY issue_coded FROM most_important_issue
WHERE is_missing(issue_coded)
ELSE VARIABLE issue_coded
USING "Most important issues (coded)";Example - classify unclassified responses
REPLACE MATERIAL MULTIPLE DICHOTOMY issue_coded FROM most_important_issue
WHERE is_missing(issue_coded)
ELSE VARIABLE issue_coded
USING "Most important issues (coded)";
Related articles
CREATE CATEGORICAL FROM <text>