Modify Data - Merge Scales (Custom)

From Q
Jump to navigation Jump to search

This feature automates the process of combining categories in many Pick One or Pick One - Multi questionsNominal/Ordinal and Nominal - Multi / Ordinal - Multi variable sets, where you would like to combine the same set of categories in each. For example, if you have a battery of 100 11-point scales, and you would like to merge the top 4, middle 3, and bottom 4 categories to all of them at once, you can do so using this feature.

Example

Consider the following likelihood scale, which we want to merge to show the Top 4 (7 to 10), Middle 3 (4 to 6), and Bottom 4 (0 to 3) categories. While you can do this by modifying rows in the table, this feature allows you to apply the same changes to many questionsvariable sets at the same time.

MergeScale434.PNG

Usage

Start by selecting Automate > Browse Online Library > Modify Data > Merge Scales (Custom). When you use this feature you will be prompted to:

  1. Choose the number of categories in the questions you want to work with. You example, if you want to merge categories in questions which are 7-point scales, choose 7 here.
  2. Choose the questions whose categories you wish to combine.
  3. Select the Source Values for the set of categories that should be combined.
  4. Enter a label for the new category.
  5. Repeat until you have specified all the combinations of categories.

If any Don't Know style options are identified you will be given the option to remove them.

  1. Select one or more variable sets under Data Sets. The variable sets should contain the same set of categories, or at least the same underlying data values.
  2. Select Anything > Data > Modify > Combine Categories > Scales (Custom)
  3. Select the values for the set of categories that should be combined.
  4. Enter a label for the new category.
  5. Repeat until you have specified all the combinations of categories.

Technical details

You should avoid making changes to the questionsvariable sets (e.g. renaming, hiding, or removing categories) prior to using this feature. If you have made changes to your questionsvariable sets, you can revert the changes by selecting a table that shows the question, right-clicking on one of the category labels, and selecting Revertselecting the variable set under Data Sets and then clicking the Reset button in the Object Inspector on the right side of the screen..

How to apply this QScript

  • Start typing the name of the QScript into the Search features and data box in the top right of the Q window.
  • Click on the QScript when it appears in the QScripts and Rules section of the search results.

OR

  • Select Automate > Browse Online Library.
  • Select this QScript from the list.

Customizing the QScript

This QScript is written in JavaScript and can be customized by copying and modifying the JavaScript.

Customizing QScripts in Q4.11 and more recent versions

  • Start typing the name of the QScript into the Search features and data box in the top right of the Q window.
  • Hover your mouse over the QScript when it appears in the QScripts and Rules section of the search results.
  • Press Edit a Copy (bottom-left corner of the preview).
  • Modify the JavaScript (see QScripts for more detail on this).
  • Either:
    • Run the QScript, by pressing the blue triangle button.
    • Save the QScript and run it at a later time, using Automate > Run QScript (Macro) from File.

Customizing QScripts in older versions

  • Copy the JavaScript shown on this page.
  • Create a new text file, giving it a file extension of .QScript. See here for more information about how to do this.
  • Modify the JavaScript (see QScripts for more detail on this).
  • Run the file using Automate > Run QScript (Macro) from File.

JavaScript

includeWeb('QScript Functions for Combining Categories');
 
applyCustomMerges(false)

See also