Announcement

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

  • Problem in merging two datasets

    Hello,

    I am trying to merge two dataset by a variable called hsn. But whenever I'm doing that, it shows - variable hsn does not uniquely identify observations in the data.

    I was wondering what can be the problem. Can someone help me? Thanks.

    Fahmida


  • #2
    the problem is exactly what Stata is telling you - in at least one of your data sets, the variable "hsn" is not distinct (i.e., there are duplicates); they can be found in several ways and you can check in several ways:
    Code:
    isid hsn
    duplicates report hsn
    
    sort hsn
    browse if hsn==hsn[_n-1] | hsn==hsn[_n+1]
    please read the FAQ and provide a data example, using -dataex- if you have additional questions

    Comment

    Working...
    X