How to Compute Binary Variables
There are many different ways of computing Binary Variables in Q. Some of the more common methods are described on this page.
Using the Automate Menu
If you are using Q version 184.108.40.206 or above, you have a menu called Automate which contains various tools specifically for computing binary variables, such as:
- Filtering - Create Filters from Selected Data (note that filter variables are binary variables)
- Create New Variables - Create New Top 2 Category Variables (That is, Top 2 Boxes)
Changing Question Type
If you have numeric variables or ratings that you wish to make categorical (e.g., if you wish to create a variable with a 1 for people that 'Agree' or 'Strongly Agree' and a 0 otherwise), you can:
- Copy and Paste the numeric or ratings variables to create new variables.
- Change their Question Type to Pick Any.
Creating combinations of variables
If you wish to create binary variables reflecting all the possible combinations of inputs variables, this is done as follows:
- Select the input variables on the Variables and Questions tab.
- Right-click and select Insert Ready-Made Formula(s) > Questions -> Pick Any with All Combinations.
Or, if you wish to have combinations of only some of the variables, you can do this by creating a Banner question.
Create filter variables either by
- Creating a Filter from the Cells on a Table
- Right-clicking on a variable in the Variables and Questions tab and selecting Insert Variable(s) > Binary - Complicated Filter to create more complicated logical expressions involving multiple variables (see Binary Variable for more information).
Constructing New Variables