This article describes how to merge data files in different languages, but the same process can be applied on any merge where you want to use one data file's labels instead of the other for the common values.
Q contains internal safety mechanisms when using Tools > Merge Data Files > Add New Cases that can cause problems when merging data files written with labels in different languages. For example, if gender in one file is shown in English in one file as 1: Male and 2: Female, but is shown in a second data file in Polish as 1: mężczyzna and 2: żeński, Q will combine the variables so that you end up with 1: Male, 2: Female, 3: mężczyzna and 4: żeński. A simple solution to this is to merge the categories in the newly-created merged data file, but this is very time-consuming.
An alternate method is outlined below.
Method
- Choose one file as the master file whose labels will be used in the final merged data file.
- To be able to use the labels from the master file, we will need to strip the labels from the values of the other file by saving it as a csv then converting that .csv back to a .sav file. Select File > New Project.
- Select File > Data Sets > Add to Project > From File and import the other file whose labels will be stripped.
- In the Data Import Window:
- Select Use original data file structure.
- Untick Tidy Up Variable Labels and Strip HTML from Labels.
- Click OK.
- Tools > Save Data as SPSS/CSV File and save it as a CSV data file.
- Now we'll read in the CSV file, and convert it back to a .sav to use in the merge. Select File > New Project.
- Select File > Data Sets > Add to Project > From File and import the CSV file.
- In the Data Import Window:
- Select Use original data file structure.
- Untick Tidy Up Variable Labels and Strip HTML from Labels.
- Click OK.
- Tools > Save Data as SPSS/CSV File and save it as an SPSS data file. This data file will no longer contain any Value Labels.
- Now, we'll add the master file to the Q project and complete the merge. Select File > New Project.
- Select File > Data Sets > Add to Project > From File and import the master file.
- In the Data Import Window:
- Select Use original data file structure.
- Untick Tidy Up Variable Labels and Strip HTML from Labels.
- Click OK.
- Tools > Merge Data Files > Add New Cases
- Press Browse and select the .sav file you just created with the stripped labels from Step 9 as the Donor data file.
- Select Prefer current file for To Resolve conflicts and press Merge Files.
- Press Save and save the new file.
- Select File > Data Sets > Update, choose your master file, and update it with the newly saved file.
Obtaining correct question names
In Q4.9.7 and earlier versions, some Question Names for multiple response questions may not appear correctly when this method is used to merge files. In this case, some extra steps are necessary to correct the question names.
For example, applying the above process results in the following change for the question Q6. Brand preference:
The correct question name information has been lost, and the resulting name is $Q6. Similar issues exist for other multiple-response questions in the project.
The solution is, having completed the steps above, to:
- Use File > Import New Data File (New Project) to import the master file, selecting Yes to any questions you are asked.
- Use File > Data Sets > Update to import the newly merged data file that was created in the steps above.
- Click Accept to the dialogue presenting any new variables that have been added in the process above.
All question names will now match those from the original data set.
Next