Using Computed Categories to Display Nonexhaustive Subtotals

Subtotals are exhaustive. That is, all subtotals in a table include all values above or below their positions in the table. Computed categories, on the other hand, are not exhaustive and allow you to sum a mix of categories in a table.

This example uses the data file survey_sample.sav. See the topic Sample Files for more information.

  1. From the menus, choose:

    Analyze > Tables > Custom Tables...

  2. Click Reset to clear any previous settings in the table builder.
  3. In the table builder, drag and drop Think of self as liberal or conservative from the variable list into the Rows area of the canvas pane.
  4. Right-click Think of self as liberal or conservative on the canvas pane and choose Categories and Totals from the pop-up context menu.
  5. Select 3 in the Value(s) list.
  6. Click Add Category to display the Define Computed Category dialog box.
  7. In the Label for Computed Category text field, type     Liberal Subtotal. Note that there are four spaces before the text. These spaces are used for indentation in the resulting table.
  8. Select Extremely liberal (1) in the Categories list and click the arrow button to copy it to the Expression for Computed Category text box.
  9. Click the plus (+) operator button in the dialog box (or press the + key on the keyboard).
  10. Select Liberal (2) in the Categories list and click the arrow button to copy it to the Expression for Computed Category text box.
  11. Click the plus (+) operator button in the dialog box (or press the + key on the keyboard).
  12. Select Slightly liberal (3) in the Categories list and click the arrow button to copy it to the Expression for Computed Category text box.
  13. Click Continue.

    This inserts a row containing the subtotal for the liberal categories.

  14. Select 7 in the Value(s) list.
  15. Click Add Category to display the Define Computed Category dialog box.
  16. In the Label for Computed Category text field, type     Conservative Subtotal. Note that there are four spaces before the text. These spaces are used for indentation in the resulting table.
  17. Select Slight conservative (5) in the Categories list and click the arrow button to copy it to the Expression for Computed Category text box.
  18. Click the plus (+) operator button in the dialog box (or press the + key on the keyboard).
  19. Select Conservative (6) in the Categories list and click the arrow button to copy it to the Expression for Computed Category text box.
  20. Click the plus (+) operator button in the dialog box (or press the + key on the keyboard).
  21. Select Extremely conservative (7) in the Categories list and click the arrow button to copy it to the Expression for Computed Category text box.
  22. Click Continue.

    This inserts a row containing the subtotal for the conservative categories.

  23. Click Apply and then click OK in the table builder to create the table.
Figure 1. Computed categories displaying nonexhaustive subtotals
Computed categories displaying nonexhaustive subtotals

The table includes two computed categories that do not include all the categories displayed in the table. The Moderate category is not included in either computed category. You cannot create the same table with subtotals because subtotals are exhaustive.