Announcement

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

  • How to make a unique identifier when working with World Bank Living Standards Measurement Survey

    Hello!
    I am trying to merge two sections of a household questionnaire together in stata, and these questionnaires come from the Uganda 2018-19 Living Standards Measurement Survey - ISA. I can't merge them together because I get an error code in stata saying "variable hhid does not uniquely identify observations in the master data". I used the merge 1:m code in my attempt to merge. How would I create a unique identifier so that I could merge these data sets together?
    Thank you!

  • #2
    Sounds like you have multiple people within a household. There's a variable pid that measures the person, so try the merge on both hhid and pid.

    Also, use joinby and not merge.

    Comment


    • #3
      thank you! what is the difference between merge and join by?

      Comment


      • #4
        joinby is better, in my experience. you can control what type of match of you get using the "unmatched" option and you get a _merge variable that tells you how it sent. And Stata's merge has issues in the m:m case.

        Comment

        Working...
        X