How to Compute Binary Variables

From Q
Jump to navigation Jump to search

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 4.8.3.0 or above, you have a menu called Automate which contains various tools specifically for computing binary variables, such as:

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:

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.

Creating Filters

Create filter variables either by

Constructing New Variables

You can also create new variables where you explicitly type the rules used to create the variables. This can by creating an Excel-Style Variable that only takes values of 0 and 1, but is generally better done by creating a binary variable in JavaScript.