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.
- Open the table builder (Analyze menu, Tables, Custom Tables).
- Click Reset to clear any previous settings in the table builder.
- Click Confidence in press in the variable list, and then Ctrl-click Confidence in TV to select both variables.
- Drag and drop the two variables into the Rows area of the canvas pane. This stacks the two variables in the row dimension.
- 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.)
- Right-click the variable again and select Categories and Totals from the pop-up menu.
- 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.
- Right-click either variable on the canvas pane and select Summary Statistics from the pop-up menu.
- 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.
- Click Column N % in the Statistics list and click the arrow key to move it to the Display list.
- Click (check) Custom Summary Statistics for Totals and Subtotals.
- 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.
- Click Mean in the custom summary Statistics list and click the arrow to move it to the custom summary Display list.
- 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.)
- In the Decimals cell, type 2.
- 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.
- 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.
- Click OK to create the table.
