Thanks--this was great. Very clear explanation. One addition that I would have appreciated seeing (just as a friendly suggestion) is to have gone back and pasted the commands to syntax so viewers could get a look at that. Thanks again.
How do you merge data from a repeated measures design where you have two key variables (person and time)? I can't put both in ascending order, so I keep getting error messages. so greatful for any hints
I have a number of dataset, all of which share the same ID number. However, some datasets have multiple rows of data for one ID number, some have just a single row of data. (1) If I merge the datasets based on ID number, given the different rows per ID number, will it work? (2) Any idea how I can select the ID numbers out of other datasets?
It sounds like you have duplicate records. If that is the case, it is possible to merge two SPSS datasets, one with duplicate records and the other without duplicates. See my other video about merging SPSS files with duplicates.
What happens to the data that if the ID numbers don't exactly match up in both files (some IDs are in both files, some IDs are only in file A, some IDS are only in file B)?
Unmatched records in file A will not be matched but will remain in the new merged file. Unmatched records from file B will be added to the new merged file, but will not be matched to a record from the original file A. If I want to keep all of the records from the original file A regardless of matching with B or not, I take a column of data in the new merged file that was from the original file A and had no missing data and sort it descending. This will bring all of the unmatched records from the original B file to the bottom of the new merged data set. I usually delete all of these so my new file contains all of the records from the original A file matched or not and only those records from B that matched A. I hope this makes sense.
Nope, no join function. The key variable from the records in the inactive dataset that have no match in the active data set will come over in the merge, but nothing else from the nonmatched record will be included.
Yeah! Its was very useful! But, in desbalanced files, one with many data from the same person (like a panel) and other with single data about person, I would choose a file with more registers!
Hi chris, i was wondering if you could help me. I've followed these steps, but when I try to add my key variables in, it says "variables are different type or length". It is true that i have something like 8,000 emails in wave 1 (day 1/data set 1), 420 in wave 2 (week 1, data set 2), and 350 in wave 3 (month later, data set 3) (emails are the variable I am matching on). The reason I want to merge them is so that I can only keep those that have matched and delete all the other emails/participants who didn't complete my survey. Thank you!
You need to make sure the key variable is exactly the same in both data sets. To do this open both data sets up side by side and look at the key variable in the variable view, For example, if your key variable is an ID number and in one set the variable name is ID, it is a string variable, and 10 characters in width. The ID variable in the second data set needs to have the exact same perimeters. I hope this helps.
HI, I am currently collecting data and new cases are coming everyday. At the same time, I need to keep my eyes on few areas and thus need to merge 3 files everyday and it can not merge the new cases with the files that I have already merged cases yesterday. Let me give an example. In dataset-1 I have 1,2,3,4,5,6,7,8,9,10. In dataset-2 I have 1,3,5,7,9. It is easy to merge and say we have merged it into dataset1and2. I have done. But after 2nd day I have new data in dataset-2 for the cases 2,4,6,8,10 and I wanted to merge it to dataset1and2 so that in this combined file I have those new cases. How do I do it ?
John Martin If I understand you correctly, it sounds like instead of merging and adding variables, you need to merge and add cases. When you go to the merge function you will see two options, add variables or add cases. Try the latter. I hope this helps, but let me know if I am not getting it.
thank you it was so useful. i merge 2 files but the values of the new variables are not correct for all of the participants. what is the problem? what should i do?
Thanks--this was great. Very clear explanation. One addition that I would have appreciated seeing (just as a friendly suggestion) is to have gone back and pasted the commands to syntax so viewers could get a look at that. Thanks again.
Thanks for the suggestion. That is a good idea.
You made my day!!! thank you for posting !
Thank you! But does it work even when there are a few random people missing from one file?
still helpful in 2017! thanks a lot!
Very clear and helpful, many thanks!
Yes, if I need to merge more than one file together (which happens a lot) I just repeat the steps as needed, one file at a time.
so helpful in 2018 ..good job
Very helpful, thank you very much! I also always refer my students to this video :-)
Thank you Chris, I guess if you want to merge many files, you just add steps?
So so helpful. Thanks!
How do you merge data from a repeated measures design where you have two key variables (person and time)? I can't put both in ascending order, so I keep getting error messages. so greatful for any hints
If you have the original SPSS software, you should have a number of very large sample data sets that are included.
Wait, there isn't a "join" function to match the key variables in case some records are missing?
I have a number of dataset, all of which share the same ID number. However, some datasets have multiple rows of data for one ID number, some have just a single row of data. (1) If I merge the datasets based on ID number, given the different rows per ID number, will it work? (2) Any idea how I can select the ID numbers out of other datasets?
It sounds like you have duplicate records. If that is the case, it is possible to merge two SPSS datasets, one with duplicate records and the other without duplicates. See my other video about merging SPSS files with duplicates.
What happens to the data that if the ID numbers don't exactly match up in both files (some IDs are in both files, some IDs are only in file A, some IDS are only in file B)?
Unmatched records in file A will not be matched but will remain in the new merged file. Unmatched records from file B will be added to the new merged file, but will not be matched to a record from the original file A. If I want to keep all of the records from the original file A regardless of matching with B or not, I take a column of data in the new merged file that was from the original file A and had no missing data and sort it descending. This will bring all of the unmatched records from the original B file to the bottom of the new merged data set. I usually delete all of these so my new file contains all of the records from the original A file matched or not and only those records from B that matched A. I hope this makes sense.
Nope, no join function. The key variable from the records in the inactive dataset that have no match in the active data set will come over in the merge, but nothing else from the nonmatched record will be included.
Yeah! Its was very useful! But, in desbalanced files, one with many data from the same person (like a panel) and other with single data about person, I would choose a file with more registers!
Hi chris, i was wondering if you could help me. I've followed these steps, but when I try to add my key variables in, it says "variables are different type or length". It is true that i have something like 8,000 emails in wave 1 (day 1/data set 1), 420 in wave 2 (week 1, data set 2), and 350 in wave 3 (month later, data set 3) (emails are the variable I am matching on). The reason I want to merge them is so that I can only keep those that have matched and delete all the other emails/participants who didn't complete my survey. Thank you!
You need to make sure the key variable is exactly the same in both data sets. To do this open both data sets up side by side and look at the key variable in the variable view, For example, if your key variable is an ID number and in one set the variable name is ID, it is a string variable, and 10 characters in width. The ID variable in the second data set needs to have the exact same perimeters. I hope this helps.
HI, I am currently collecting data and new cases are coming everyday. At the same time, I need to keep my eyes on few areas and thus need to merge 3 files everyday and it can not merge the new cases with the files that I have already merged cases yesterday. Let me give an example. In dataset-1 I have 1,2,3,4,5,6,7,8,9,10. In dataset-2 I have 1,3,5,7,9. It is easy to merge and say we have merged it into dataset1and2. I have done. But after 2nd day I have new data in dataset-2 for the cases 2,4,6,8,10 and I wanted to merge it to dataset1and2 so that in this combined file I have those new cases. How do I do it ?
John Martin If I understand you correctly, it sounds like instead of merging and adding variables, you need to merge and add cases. When you go to the merge function you will see two options, add variables or add cases. Try the latter. I hope this helps, but let me know if I am not getting it.
thank you it was so useful.
i merge 2 files but the values of the new variables are not correct for all of the participants. what is the problem?
what should i do?
Sorry for the late reply, but the values need to be the same in both datasets before the merge.
Thank you, Chris
amazing thanks so much
Perfect
thank you chirs
Thank YOU!
thanks alot
thank you..
johnP
thank you