Announcement

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

  • variable id does not uniquely identify observations in the using data

    Dear All,

    I have two datasets. First collected from 600 people (wave 1), which was intended to measure some baseline attitudes, and then after that a sub-sample of these subjects were randomly assigned to treatment groups (wave 2), n=130. Now I am trying to merge the wave 1 data with the wave 2 data. Both of them have the variable ID number, and the merge should be matched with ID numbers. But everytime I try the following:

    merge m:1 id using "C:\Users\U0114841\Desktop\dataforoxfordultimate\w ave_1_ultimate_dataset_clean.dta"

    I get the below message:
    variable id does not uniquely identify observations in the using data

    I have no idea why. I would appreciate so much if you could help me out with this.

    Thanks a lot.

    Best,

    Marie Sofie

  • #2
    Code:
    use "C:\Users\U0114841\Desktop\dataforoxfordultimate\w ave_1_ultimate_dataset_clean.dta", clear
    duplicates examples id

    Comment


    • #3
      This sounds like a 1:1 merge, not m:1, but that is not what is breaking the code. I would open each file and check to see if id has any duplicates:

      Code:
      isid id
      The -duplicates- command will be useful if that check fails.

      Comment


      • #4
        It is fabulous! Thanks a million for these advices. It does indeed work now, after I have cleaned up the duplicates.

        Comment

        Working...
        X