Introduction
This article describes how to merge files by variable
In this example, two files census_05_demographics_men_women.sav and census_05_attitudes.sav were merged. Variables with the black box in the first column came from the demographics file and those on the second column from the attitudes files. Both files have a common variable called ID.
Requirements
- A professional user license.
- Files to be merged must be stored on the Displayr Cloud Drive
- FIles to be merged must be .sav files
Method
File name specification
- Select Anything > Data > Data Set > Combine > by Variable
- In Inputs > Data sets, type the name of the first file in the Data set 1 box
- In Inputs > Data sets, type the name of the second file in the Data set 2 box
- Type the name of the merged data set in the Combined data set name box. By default, it will be called Combined data set.sav
Case Matching
You can either join cases by Matching IDs or join them side by side with no matching. The latter method is useful if both files have the same cases but do not have an ID variable. Case 1 will be matched with Case 1, Case 2 with Case 2, etc. You should only use this method if the cases in both files are in the same order and both files have the same number of cases.
It is usually preferable to match by an ID variable if one is available.
Variables
Specify the names of the variables that should or should not be combined. Also, the variables that should be manually included or omitted from the combined data set.
Names and Labels
When the labels or names for matching variables are not identical, you can either use the ones from the first data set or the last data set. Also, if there are multiple labels for the same value, you can either use the ones from the preferred data set or create new ones.
Automatic Updating
Use Automatic updating if you want the merge to refresh automatically after a specified time period.
Comments
0 comments
Article is closed for comments.