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.
- Open the table builder (Analyze menu, Tables, Custom Tables).
- Click Reset to clear any previous settings in the table builder.
- 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.)
- 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.
- Click Get news from internet on the canvas pane so that only that variable is selected.
- Now right-click Get news from internet and select Summary Statistics from the pop-up menu.
- 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.)
- 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.
- Right-click Get news from newspapers on the canvas pane and select Summary Statistics from the pop-up menu.
- In the Summary Statistics dialog box, select Column N % from the Statistics list and click the arrow to add it to the Display list.
- Then click Apply to All.
Now the table preview indicates that column percentages will be displayed for all of the stacked variables.