Merge of SPSS data files

 The methods of merging data files are divided into case merging and variable merging .

  • Case merging refers to merging the cases of one data file into another data file when the two data files have the same common variables.
  • Variable merging means that when two data files have common cases, the variables of one data file are merged into the corresponding cases of the other data file.
     

 1. Case Merging

(1) Open the data of file 1 and file 2 as follows

 

(2) Click Yes "Data" - "Merge Files" - "Add Case" 

 

(3) The pop-up dialog box is as follows, click Continue 

 (4) Forcibly move the two variables "academy" and "college" to the right, and the variable "course nature" can be selectively moved, as shown on the right after the variable names are merged

(5) The final results after merging cases are as follows 

 

2. Variable merging

(1) Open two files respectively as follows

 

 It can be seen that the course number of file 1 is missing 2 and 3, and the course number of file 2 is missing 8 and 9.

(2) Select "Data" - "Merge File" - "Add Variable" in file 1 

(3) Select data file 2 and click Continue 

  • There are three merge methods in the pop-up dialog box, namely: 1. One-to-one merge based on file order, 2. One-to-one merge based on key value, 3. One-to-many merge based on key value

 

(4) First select the first type: one-to-one merge based on file order, click OK, the result is as follows

(5) Choose the second type: one-to-one merge based on key value, click "Variable", move "Course Number" to the key variable, click OK, the result is as follows 

 

 (6) Choose the third type: one-to-many merge based on key value, also move the "course number" to the key variable, click OK, the result is as follows 

 

 Observe the results of the three methods, and pay attention to the similarities and differences of the three different operation methods.

Guess you like

Origin blog.csdn.net/m0_64087341/article/details/131714756