discoverhotmail.com

Why discoverhotmail.comFeaturesNew in discoverhotmail.com 17Disciplinesdiscoverhotmail.com/MPWhich discoverhotmail.com is best for me?Supported platforms

Bookstore

discoverhotmail.com push booksBooks ~ above discoverhotmail.comBooks on statistics

discoverhotmail.com Journaldiscoverhotmail.com PressGift Shop
Order discoverhotmail.comRequest a quotePurchasing FAQsBookstore

discoverhotmail.com press booksBooks on discoverhotmail.comBooks top top statistics

discoverhotmail.com JournalGift Shop
NetCoursesClassroom and also web trainingOn-site trainingWebinarsVideo tutorialsThird-party coursesWeb resourcesTeaching through discoverhotmail.com
Ready. Set. Go discoverhotmail.com.Installation GuideUpdatesFAQsDocumentationRegister discoverhotmail.comTechnical services

PolicyContact

Video tutorialsFree webinarsPublications

Bookstorediscoverhotmail.com Journaldiscoverhotmail.com News

Author assistance ProgramEditor assistance ProgramTeaching through discoverhotmail.comExamples and also datasetsWeb resourcesTrainingdiscoverhotmail.com Conferences

2022 discoverhotmail.com ConferenceUpcoming meetingsProceedings

The discoverhotmail.com Blogdiscoverhotmail.comlistSocial mediaEmail alertsDisciplines
Announcementsdiscoverhotmail.comCorp

Contact usHours of operation

Customer service

Register discoverhotmail.com onlineChange registrationChange addressSubscribe come discoverhotmail.com NewsSubscribe to email alerts

International resellersCareersOur sites

discoverhotmail.comlistThe discoverhotmail.com Blogdiscoverhotmail.com Pressdiscoverhotmail.com Journal


*

» residence » resources & support » frequently asked questions » enhance merging when there space duplicate IDs

Why does my merge produce a dataset with too numerous observations?

Title Match merging as soon as there are duplicate IDs
Author William Gould, discoverhotmail.comCorp

Your problem is most likely caused by having actually duplicate IDs. Duplicate IDs can reason unexpected results when doing a enhance merge. Consider the complying with examples:

Example 1. There room too plenty of observations in the an unified dataset

The understand dataset has actually 5 observations, and also the making use of dataset has 8 observations. As soon as you do the merge, every observation has a _merge code of 2 or 3 (every monitoring in the grasp dataset was matched), yet the merged dataset contains 9 observations.

You are watching: Variable does not uniquely identify observations in the master data

Cause: Duplicate monitorings in the smaller sized dataset (and possibly in the larger one, too).

. Usage junk2 . List +--------+ | identifier y | |--------| 1. | 1 1 | 2. | 1 2 | 3. | 1 3 | 4. | 2 1 | 5. | 3 1 | |--------| 6. | 3 2 | 7. | 4 1 | 8. | 5 1 | +--------+. Usage junk1, clear . Sort id x. List +--------+ | identifier x | |--------| 1. | 1 1 | 2. | 1 2 | 3. | 2 1 | 4. | 2 2 | 5. | 3 1 | +--------+. Merge id utilizing junk2variable identifier does not uniquely identify observations in the grasp datavariable identifier does no uniquely determine observations in junk2.dta. List +---------------------+ | identifier x y _merge | |---------------------| 1. | 1 1 1 3 | 2. | 1 2 2 3 | 3. | 2 1 1 3 | 4. | 2 2 1 3 | 5. | 3 1 1 3 | |---------------------| 6. | 1 2 3 3 | 7. | 3 1 2 3 | 8. | 4 . 1 2 | 9. | 5 . 1 2 | +---------------------+ study x and also y, and you will certainly see how merge matches increase duplicates.

Example 2. Much more matches than observations in the smallest dataset

there are just 3 monitorings in your understand dataset, yet, as soon as you do the merge, there space 4 observations that have actually a _merge password of 3 (meaning the observations are in both datasets).

Cause: There space duplicates in the using dataset.

See more: How Many Days Till March 23 2017 ? Days Calculator: Days Between Two Dates

. Use junk2, clear . List +--------+ | identifier y | |--------| 1. | 1 1 | 2. | 1 2 | 3. | 1 3 | 4. | 2 1 | 5. | 3 1 | |--------| 6. | 3 2 | 7. | 4 1 | 8. | 5 1 | +--------+ . Usage junk1, clear . Type id x . List +--------+ | i would x | |--------| 1. | 1 1 | 2. | 2 2 | 3. | 3 3 | +--------+. Merge id utilizing junk2 variable identifier does not uniquely determine observations in junk2.dta. List +---------------------+ | id x y _merge | |---------------------| 1. | 1 1 1 3 | 2. | 2 2 1 3 | 3. | 3 3 1 3 | 4. | 1 1 2 3 | 5. | 1 1 3 3 | |---------------------| 6. | 3 3 2 3 | 7. | 4 . 1 2 | 8. | 5 . 1 2 | +---------------------+

Finding duplicate IDs

The duplicates and also isid commands assist identify and address duplicate observations.