Announcement

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

  • Why does it say the variables does not uniquely identify when I use m:1 merge command?

    Hello guys,

    I have a dataset containing gps information(master).
    I want to merge weather information to the master dataset.
    The master set has 50 ids and location and dates. Some people were in the same location on the same day, so there are duplicates in the master.

    I used location date to merge and used m:1 option but it says the master does not uniquely identify.
    Of course it does not uniquely match and that's why I wanna do it in stata.

    Could someone please help me with this?

  • #2
    Depending on what is the using dataset and what is the master dataset, you may need

    Code:
    merge 1:m
    instead. However, the key variables in one of the datasets must uniquely identify the observations. Presumably, this should be the weather dataset where you have one observation per location and day. Run

    Code:
    isid location day
    to verify this.

    Some people were in the same location on the same day
    If they were there at different times, the weather might have been different. In such cases, you would likely need both the location and the specific hour, or even a more precise time unit like minutes.

    Comment

    Working...
    X