Announcement

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

  • merging data sets

    hello everyone, please I need your help as I'm new to Stata

    I am trying to merge two data sets. one has household_id as its unique identifier while the other one has household_id also, however, the isid command returned an error. when i tried isid household_id individual_id no error was returned. now my question is how do I merge these two data sets. the unit of observations from the first one is household while the other one includes observations from members of the household

  • #2
    [CODE]
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str18 household_id double individual_id str15 ea_id double(saq14 pw_w4 saq01) str2(saq02 saq03) double(saq04 saq05) str3 saq06 str2 saq07 double saq08 str16 s1q00 double(s1q01 s1q02 s1q03a s1q10)
    "010101088800910007" 1 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 7 "**CONFIDENTIAL**" 1 2 61 .
    "010101088800910007" 2 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 7 "**CONFIDENTIAL**" 3 1 27 .
    "010101088800910007" 3 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 7 "**CONFIDENTIAL**" 3 2 20 .
    "010101088800910007" 4 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 7 "**CONFIDENTIAL**" 8 1 12 .
    "010101088800910007" 5 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 7 "**CONFIDENTIAL**" 7 2 11 .
    "010101088800910007" 6 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 7 "**CONFIDENTIAL**" 8 1 8 .
    "010101088800910007" 7 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 7 "**CONFIDENTIAL**" 4 1 0 .
    "010101088800910017" 1 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 17 "**CONFIDENTIAL**" 1 2 40 .
    "010101088800910017" 2 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 17 "**CONFIDENTIAL**" 3 2 15 .
    "010101088800910017" 3 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 17 "**CONFIDENTIAL**" 3 2 10 .
    "010101088800910017" 4 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 17 "**CONFIDENTIAL**" 3 1 8 .
    "010101088800910017" 5 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 17 "**CONFIDENTIAL**" 3 1 5 .
    "010101088800910026" 1 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 26 "**CONFIDENTIAL**" 1 2 35 1
    "010101088800910026" 2 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 26 "**CONFIDENTIAL**" 3 2 16 .
    "010101088800910026" 3 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 26 "**CONFIDENTIAL**" 3 2 13 .
    "010101088800910026" 4 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 26 "**CONFIDENTIAL**" 3 2 11 .
    "010101088800910026" 5 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 26 "**CONFIDENTIAL**" 3 1 8 .
    "010101088800910026" 6 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 26 "**CONFIDENTIAL**" 3 1 0 .
    "010101088800910026" 7 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 26 "**CONFIDENTIAL**" 3 2 0 .
    "010101088800910026" 8 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 26 "**CONFIDENTIAL**" 2 1 38 1
    "010101088800910029" 1 "010101088800910" 1 2892.689142857143 1 "01" "01" 8 88 "009" "10" 29 "**CONFIDENTIAL**" 1 2 20 .
    "010101088800910029" 2 "010101088800910" 1 2892.689142857143 1 "01" "01" 8 88 "009" "10" 29 "**CONFIDENTIAL**" 3 1 1 .
    "010101088800910038" 1 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 38 "**CONFIDENTIAL**" 1 1 53 1
    "010101088800910038" 2 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 38 "**CONFIDENTIAL**" 2 2 49 1
    "010101088800910038" 3 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 38 "**CONFIDENTIAL**" 13 1 25 .
    "010101088800910038" 4 "010101088800910" 1 1658.475108571429 1 "01" "01" 8 88 "009" "10" 38 "**CONFIDENTIAL**" 3 2 32 .
    --more--

    Comment

    Working...
    X