# Custom Total Summary Statistics for Categorical Variables

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

For categorical statistics source variables, you can include custom total summary statistics that are different from the statistics displayed for the categories of the variable. For example, for an ordinal variable, you could display percentages for each category and the mean or median for the custom total summary statistic.

1. Open the table builder (Analyze menu, Tables, Custom Tables).
2. Click Reset to clear any previous settings in the table builder.
3. Click Confidence in press in the variable list, and then Ctrl-click Confidence in TV to select both variables.
4. Drag and drop the two variables into the Rows area of the canvas pane. This stacks the two variables in the row dimension.
5. Right-click either variable on the canvas pane and select Select All Row Variables from the pop-up menu. (They may both already be selected, but we want to make sure.)
6. Right-click the variable again and select Categories and Totals from the pop-up menu.
7. In the Categories and Totals dialog box, click (check) Total, and then click Apply.

The table preview on the canvas pane now displays a total row for both variables. In order to display custom total summary statistics, totals and/or subtotals must be specified for the table.

8. Right-click either variable on the canvas pane and select Summary Statistics from the pop-up menu.
9. In the Summary Statistics dialog box, click Count in the Display list and click the arrow to move it to the Statistics list, removing it from the Display list.
10. Click Column N % in the Statistics list and click the arrow key to move it to the Display list.
11. Click (check) Custom Summary Statistics for Totals and Subtotals.
12. Click Count in the custom summary Display list and click the arrow to move it to the custom summary Statistics list, removing it from the Display list.
13. Click Mean in the custom summary Statistics list and click the arrow to move it to the custom summary Display list.
14. Click the Format cell for the mean in the Display list and select nnnn from the drop-down list of formats. (You may have to scroll up the list to find this choice.)
15. In the Decimals cell, type 2.
16. Click Apply to All to apply these settings to both variables in the table.

A new column has been added for the custom total summary statistic, which may not be what you want, since the preview on the canvas pane clearly indicates that this will result in a table with many empty cells.

17. In the table builder, in the Summary Statistics group, select Rows from the Position drop-down list.

This moves all the summary statistics to the row dimension, displaying all summary statistics in a single column in the table.

18. Click OK to create the table.