Categories and Totals
The Categories and Totals dialog box allows you to:
- Reorder and exclude categories.
- Insert subtotals and totals.
- Insert computed categories.
- Include or exclude empty categories.
- Include or exclude categories defined as containing missing values.
- Include or exclude categories that do not have defined value labels.
- This dialog box is available only for categorical variables and multiple response sets. It is not available for scale variables.
- For multiple selected variables with different categories, you cannot insert subtotals, insert computed categories, exclude categories, or manually reorder categories. This occurs only if you select multiple variables in the canvas preview and access this dialog box for all selected variables simultaneously. You can still perform these actions for each variable separately.
- For variables with no defined value labels, you can only sort categories and insert totals.
To Access the Categories and Totals Dialog Box
This feature requires the Custom Tables option.
- Open the table builder (Analyze menu, Tables, Custom Tables).
- Drag and drop a categorical variable or multiple response set onto the canvas pane.
- Right-click the variable on the canvas pane, and select Categories
and Totals from the pop-up menu.
- Select (click) the variable on the canvas pane, and then click Categories
and Totals in the Define group on the Table tab.
You can also select multiple categorical variables in the same dimension on the canvas pane:
- Ctrl-click each variable on the canvas pane.
- Click outside the table preview on the canvas pane, and then click
and drag to select the area that includes the variables you want to
- Right-click any variable in a dimension and select Select All [dimension] Variables to select all of the variables in that dimension.
To Reorder Categories
To manually reorder categories:
- Select (click) a category in the list.
- Click the up or down arrow to move the category up or down in
- Click in the Value(s) column for the category, and drag and drop it in a different position.
To Exclude Categories
- Select (click) a category in the list.
- Click the arrow next to the Exclude list.
- Click in the Value(s) column for the category and drag and drop it anywhere outside the list.
If you exclude any categories, any categories without defined value labels will also be excluded.
To Sort Categories
You can sort categories by data value, value label, cell count, or summary statistic in ascending or descending order.
- In the Sort Categories group, click the By drop-down list and select the sort criterion you want to use: value, label, count, or summary statistic (such as mean, median, or mode). The available summary statistics for sorting depends on the summary statistics you have selected to display in the table.
- Click the Order drop-down list to select the sort order (ascending or descending).
Sorting categories is not available if you have excluded any categories.
- Select (click) the category in the list that is the last category in the range of categories that you want to include in the subtotal.
- Click Add Subtotal....
- In the Define Subtotal dialog box, optionally modify the subtotal label text.
- To show only a subtotal and suppress the display of the categories that define the subtotal, select Hide subtotaled categories from the table.
- Click Continue to add the subtotal.
- Click the Total check box. You can also modify the total label text.
If the selected variable is nested within another variable, totals will be inserted for each subtable.
Display Position for Totals and Subtotals
Totals and subtotals can be displayed above or below the categories included in each total.
- If Below is selected in the Totals and Subtotals Appear group, totals appear above each subtable, and all categories above and including the selected category (but below any preceding subtotals) are included in each subtotal.
- If Above is selected in the Totals and Subtotals Appear group, totals appear below each subtable, and all categories below and including the selected category (but above any preceding subtotals) are included in each subtotal.
Important: You should select the display position for subtotals before defining any subtotals. Changing the display position affects all subtotals (not just the currently selected subtotal), and it also changes the categories included in the subtotals.
You can display categories computed from summary statistics, totals, subtotals, and/or constants. See the topic Computed Categories for more information.
Custom Total and Subtotal Summary Statistics
You can display statistics other than "totals" in the Totals and Subtotals areas of the table using the Summary Statistics dialog box. See the topic Summary Statistics for Categorical Variables for more information.
Note: If you select multiple custom total statistics that are also in the body of the table and you hide the statistics labels, then the totals are resorted into the same order as in the body of the table—and since the labels aren't displayed, you may not know what each total statistic actually represents. In general, selecting multiple statistics and hiding the statistics labels is probably not a good idea.
Totals, Subtotals, and Excluded Categories
Cases from excluded categories are not included in the calculation of totals.
Missing Values, Empty Categories, and Values without Value Labels
Missing values. This controls the display of user-missing values, or values defined as containing missing values (for example, a code of 99 to represent "not applicable" for pregnancy in males). By default, user-missing values are excluded. Select (check) this option to include user-missing categories in tables. Although the variable may contain more than one missing value category, the table preview on the canvas will display only one generic missing value category. All defined user-missing categories will be included in the table. System-missing values (empty cells for numeric variables in the Data Editor) are always excluded.
Empty categories. Empty categories are categories with defined value labels but no cases in that category for a particular table or subtable. By default, empty categories are included in tables. Deselect this option to exclude missing categories from the table.
Other values found when data are scanned. By default, category values in the data file that do not have defined value labels are automatically included in tables. Deselect this option to exclude values without defined value labels from the table. If you exclude any categories with defined value labels, categories without defined value labels are also excluded.