Stacked Variables

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

Since a stacked table can contain multiple statistics source variables and you can specify different summary statistics for each of those statistics source variables, there are a few special considerations for specifying summary statistics in stacked tables.

  1. Open the table builder (Analyze menu, Tables, Custom Tables).
  2. Click Reset to clear any previous settings in the table builder.
  3. Click Get news from internet in the variable list and then shift-click Get news from television in the variable list to select all of the "news" variables. (Note: This assumes that variable labels are displayed in alphabetical order, not file order, in the variable list.)
  4. Drag and drop the five news variables into the Rows area of the canvas pane.

    The five news variables are stacked in the row dimension.

  5. Click Get news from internet on the canvas pane so that only that variable is selected.
  6. Now right-click Get news from internet and select Summary Statistics from the pop-up menu.
  7. In the Summary Statistics dialog box, select Column N % from the Statistics list and click the arrow to add it to the Display list. (You can use the arrow to move selected statistics from the Statistics list into the Display list, or you can drag and drop selected statistics from the Statistics list into the Display list.)
  8. Then click Apply to Selection.

    A column is added for column percentages--but the table preview on the canvas pane indicates that column percentages will be displayed for only one variable. This is because in a stacked table there are multiple statistics source variables, and each one can have different summary statistics. In this example, however, we want to display the same summary statistics for all variables.

  9. Right-click Get news from newspapers on the canvas pane and select Summary Statistics from the pop-up menu.
  10. In the Summary Statistics dialog box, select Column N % from the Statistics list and click the arrow to add it to the Display list.
  11. Then click Apply to All.

Now the table preview indicates that column percentages will be displayed for all of the stacked variables.