Before you follow the steps in this article, please make sure you have exported your data properly. See here how you can export to SPSS. Save your .sav files, e.g. 'studydata.sav' and 'reports_bloodpressure.sav'.
If you want to merge files in a wide format (i.e., for every report/survey instance, new columns are added), follow the steps below for '1. Restructure report data to wide format'. If you want to merge files in a long format (i.e., for every report/survey instance, a row is added for a record), skip to '2. Merging study data and report/survey data'.
1. Restructure report/survey data to wide format
- Open your report or survey file. In this example we'll use the report file 'report_bloodpressure.sav'.
Click Data > Restructure
Select 'Restructure selected cases into variables'. Click Next.
Select 'record_id' as Identifier Variable. Click Next.
Select Yes for 'Sort the current data?'. Click Finish. Every report/survey variable will have a suffix '.X' with X being the number of the report/survey instance.
To merge your study and report/survey data, follow the steps below from 'Merge study data and report/survey data'.
2. Merge study data and report/survey data
- Let's say you want to merge the .sav files 'studydata.sav' and 'reports_bloodpressure.sav'.
- Make sure you sort the column 'record_id' in both files:
- Right click on the name of the column.
- Click 'Sort Ascending'.
- Open 'studydata.sav'.
- Click 'Data' > 'Merge files' > 'Add variables'.
- Select the dataset you want to merge, so e.g. 'reports_bloodpressure.sav'. Click 'Continue'.
- 'Match cases on key variables'
- 'Cases are sorted in order of key variables in both datasets'
- 'Both files provide cases'
- Select 'record_id' as key variable.
- Click 'OK'.