Select Sequential numbers for your index variable and click Finish. The index variable keeps track of which original variable each case in the stacked data corresponds to.ĩ. Select the option for creating a Single index variable and click Next. Move any variables which you want to keep in the data, but which do not need to be stacked, into box under Fixed Variable(s). Highlight the variables for the group in the list on the left, and use the arrow button to move them into box below Target Variable.
SPSS has created generic names for these, which will be trans1, trans2, etc.ī. Describe each group of stacked variables in the Variables to be Transposed section:Ī.Choose one of the variables in the data file to be the ID variable, and select it in the Case Group Identification.In this example there are 10 groups of variables (one for the Likelihood to recommend survey question, and 9 groups of brand attribute variables). Choose to stack More than one variable, and enter the number of groups of variables that you are stacking.Choose the option to Restructure selected variables into cases, and click Next.This will open the Restructure Data Wizard. These steps focus on stacking the example data file linked above. There are some additional options along the way which you can select according to your needs. Once you have your data set loaded into SPSS you can stack your data file using the following steps. Which other variables in the data are to be included but not stacked? These will be stretched, which means that their values will be repeated several times for each of the original cases.Which variables are to be stacked, and how many stacked variables will there be in the final data set? In the image above, there are 3 stacked variables in the final stacked data.
How do you get syntax out of spss 23 download#
You can download the data file that we used from:Ī subset of the data before and after stacking is shown in the image below.īefore you start stacking you should work out: In this example we consider data from a simple survey which asked people about how they rate different technology brands.
How do you get syntax out of spss 23 how to#
In this article we look at how to stack data that has been loaded into SPSS Statistics, using both the interactive wizard and using syntax via the VARTOCASES command. The number of variables in the data decreases, and the number of cases increases. Data stacking is a data preparation step where a data set is split into subsets, and the subsets are merged by case (or stacked on top of one another).