Creating Weights With Different Mergings

From Q
Jump to: navigation, search

This page describes how to create weights in situations where you want to collapse or merge different categories of a target variable. The instructions below describe how you would weight by age and gender, where, for males, the age categories are under 40 versus 40+, for females, they are under 50 versus 50+, and the targets are 25% in each of the four cells.

  1. Select the variable that you wish to have different mergings of (in this case, age) in the Variables and Questions tab.
  2. Right-click and select Copy and Paste Variable(s) > Linked
  3. Right-click on the new variable and select Edit variable.
  4. Replacing the Expression with the following, where you substitute age and gender for whatever variable Names are applicable: if (gender == 1) 99; else age;
  5. Change the Label to something instructive, e.g., "Age Groups Male".
  6. Click OK.
  7. Right-click on the new variable and select Copy and Paste Variable(s) > Exact Copy.
  8. Right-click on the new, copied, variable and select Edit variable, updating the Expression to: if (gender == 2) 99; else age;
  9. Change the label to, e.g., "Age Groups Female".
  10. Click OK.
  11. Repeat this process for any remaining categories of the first variable.
  12. In the menu, go to Create > Variables and Questions > Variable(s) > Weight.
  13. In the Target question(s) drop-down, select the first newly created variable.
  14. Merge together the categories as desired by dragging and dropping, but leaving 99 unmerged.
  15. Enter appropriate targets. For example, 25%, 25%, and 50%, where the last category is the sum of all the other targets.
  16. Click Add Weight Set and repeat the previous three steps for any remaining variables.
  17. Click OK when finished.