Suppose you want to compare two files to see if they are identical or not.
In SPSS, COMPARE DATASETS compares the active dataset to another dataset to check identical or mismatching values in variables.
Data File 1
Data File 2
In SPSS, COMPARE DATASETS compares the active dataset to another dataset to check identical or mismatching values in variables.
Data File 1
Name | Score1 | Score2 | Score3 |
---|---|---|---|
Sam | 77 | 68 | 66 |
Deepanshu | 50 | 71 | 89 |
Sandy | 71 | 91 | 50 |
Shane | 55 | 78 | 89 |
Roger | 50 | 97 | 86 |
Iqbal | 56 | 63 | 56 |
Priya | 88 | 68 | 93 |
Data File 2
Name | Score1 | Score2 | Score3 |
---|---|---|---|
Sam | 77 | 68 | 66 |
Deepanshu | 50 | 94 | 89 |
Sandy | 71 | 91 | 50 |
Shane | 55 | 78 | 89 |
Roger | 50 | 74 | 81 |
Iqbal | 56 | 63 | 56 |
Priya | 81 | 68 | 92 |
Step 1 : Set up the above data sets in SPSS
Data File 1
Note : Edit the file path in the above syntax- "C:\Desktop\datafile2.sav".
Step 2 : Open *Data File 1* SPSS File
Step 3 : Run the following syntax
1. The COMPDATASET subcommand specifies the dataset that will be compared to the active dataset.
2. Change the file path with the path where datafile2 is saved.
3. The VARIABLES subcommand specifies the variables to be compared.
Examples :
1. If you want to compare files on the basis of Score1 variable
The VARIABLES subcommand will be : /VARIABLES Score1 .
2. If you want to compare files on the basis of two variables - Score1 and Score2
The VARIABLES subcommand will be : /VARIABLES Score1 Score2 .
3. If you want to compare files on the basis of all the variables
The VARIABLES subcommand will be : /VARIABLES ALL .
very nice site
ReplyDelete