You’ve just spent hours finding the perfect data for your project. The problem now is that you have two (or more) different data sets and you need to smoosh them all into one. Here is how you can do that:

YouTube video: California State University, ITS Training Program

1. First, the two data sets you want to merge need to have a common, unique identifier (key variable) for each case in your data set. Both data files should provide different data for the same set of cases. Also, make sure the cases are spelled exactly the same and are in the same order in both data sets (You could try sorting them in ascending order before trying to merge).

2. Open the first file that you wish to merge. Under the “Merge Files” item in the Data menu, select “Add Variables”

3. Select the file you wish to merge

4. If the cases have the same name one will show up in the “Excluded Variables” list. This will be the common variable that you will use to merge the data files together. If your key variables have different names you should rename one so they both have the same name. Select the key variable from the “Excluded Variables” list and check the “Match cases on key variables in sorted files” checkbox. Then send the variable to the key variables box (using the arrow pointing to the right).

5. Click OK. SPSS will give you a warning regarding sorted key variables. If everything is in order (make sure both files have key variables that are spelled the same and are sorted in order before trying to do a file merge) click OK again. All variables from both files will be merged in a new datafile, and cases are matched by the key variable.

As always, ask a consultant for help if you get lost!

Advertisements