Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Merge

    Hi all,

    I have a quick doubt. If I have two databases DB1 and DB2. DB1 has more observations (i.e. IDs) with respect to DB1 and DB2 has fewer observations than DB1. Some of the observations appear in DB1 but not in DB2 and vice versa. The identifier is unique and there are no duplicates.
    If I want to merge the two Databases using merge 1:1 the result will be that variables in common are merged together (i.e. _merge == 3) and variables of DB1 that were not in DB2 added as well as variables that were in DB2 but not in DB1 right? I mean, merge 1:1 if I want all the unique IDs from both databases to appear is the right thing to do?

    Thank you!

  • #2
    Yes, you have it right. -merge 1:1 ID using DB2- will create a data base that contains all IDs that appear in either data set. Some will be matched, and some will be only from DB1. You can tell which are which by looking at the _merge variable (which will be 3 for those that are matched, and 1 for those that are found only in DB1).

    Comment


    • #3
      Thank you Clyde !

      Comment

      Working...
      X