See Crunch Automation basics for more information.
The SET EXCLUSION command allows you to set the dataset’s exclusion filter based on a condition. For information about how to write conditions, see the conditions/expressions section of the Crunch Automation basics article.
This command can be used to remove any exclusion that a dataset may have by setting it to NULL. For example:
SET EXCLUSION NULL
Exclusions are used to exclude cases (typically respondents) who you don’t want in the study. This aspect of data cleaning can involve removing "speedsters," those who should have screened-out, "straightliners," outliers, those with illogical answers, and more.
Exclusions do not permanently delete cases—it simply hides them (as though the cases weren’t part of the data). If you remove the exclusion, then the cases would be reinstated.
You can rerun this command to change the exclusion at any point.
SET EXCLUSION (condition|NULL);
Use case
Using the 2019 Core Trends Broadband and Mobile Study, we look at an example where we don't want to include anyone who doesn't provide their age (i.e., it was a screening criterion):
SET EXCLUSION
age = "(VOL) Refused" OR age = "(VOL) Don't know";
All of the variables in the dataset should update accordingly. In the following, you can see the Valid base count has decreased by 56 to become 1,446. The n=56 here are not considered missing data: the n=56 are excluded from the dataset completely:
In the same sample dataset, age was also captured numerically. But, the 'Don’t know' and 'Refused' categories were coded as 98 and 99 respectively, thus misrepresenting the distribution in the numeric variable (see the spike at the end of the histogram):
The same exclusion as per the outcome above could also be expressed as:
SET EXCLUSION
age_num >= 98;
Notice the outcome in both of the following: