[Skip Global Navigation]

SPSS Tech Tips

SPSS Direct Home

Saving multiple response set definitions in SPSS for Windows®

This is a complimentary tip available to SPSS Direct subscribers.

Question

I frequently use multiple response sets in my analysis with SPSS for Windows. When I close the file that I am working with, the sets I have defined seem to disappear. Is there a way to save these sets so that I can reference them in future analyses?

Answer

The multiple response sets that are defined through dialog boxes only exist for as long as that current session of SPSS for Windows remains open. When you run a multiple response frequency or crosstab, the set is actually created within the syntax for that table, and only exists while that syntax is run. The menu provides a convenient graphical interface to associate variables into sets, but SPSS for Windows actually recreates each set every time the multiple response frequency or crosstab is run.

However, if you have the SPSS Tables™ add-on module, the sets that are created through those dialog boxes are saved from session to session—as long as you save the data file in which the sets were created.

If you do not have SPSS Tables, or if you wish to continue using the regular multiple response option, the only way to "save" the multiple response set is to save the syntax that creates the multiple response table.

To do this, create the multiple response sets as you normally would, and then set up your multiple response table. Instead of clicking on “OK,” click on “Paste.” The table will not run, but the syntax that creates the table will be pasted into an SPSS syntax file. For example, the following syntax creates a crosstab table of the multiple response variable, health, and another variable, sex:



MULT RESPONSE
GROUPS=$health (hlth1 hlth2 hlth3 hlth4 hlth5 (1))
/VARIABLES=sex(1 2)
/TABLES=$health BY sex
/BASE=CASES .


The GROUPS subcommand defines the multiple response set (in this case, a multiple dichotomy set), and the VARIABLES subcommand defines which regular variables will be used in the crosstab, as well as their ranges. The TABLES subcommand creates the table, where “$health” is the multiple response set we created on the GROUPS command and sex is the regular table. You can save this syntax by going to File->Save and naming the syntax file.

In the future, if you would like to create a multiple response crosstab using the same multiple response set, but with another variable, such as race, then you can use the previously saved syntax as a starting point.

First, open your dataset, and then go to File->Open. Select SPSS syntax as your file type, and open up the syntax file you saved previously. Modify the syntax as shown below:



MULT RESPONSE
GROUPS=$health (hlth1 hlth2 hlth3 hlth4 hlth5 (1))
/VARIABLES=race(1 3)
/TABLES=$health BY race
/BASE=CASES .


The GROUPS subcommand can remain the same, and the same set can be re-created. However, change the VARIABLES designation to race, and then change the range to reflect the range of the race variable. Next, replace sex with race on the TABLES subcommand. Then highlight the syntax, and go to Run->Selection. In the output window, you should see a crosstab that uses the same multiple response set, but with race rather than sex.

Remember, the multiple response set only remains within the syntax that creates it and uses it. If you want to use the multiple response set again, you’ll need to run the multiple response groups syntax again, and change the VARIABLES and TABLES subcommands as needed. It’s important to note that these sets will not show up under Multiple Response->Define Sets, unless you redefine them through the menus.