Hello,
I am trying to merge data sets with many waves. Both have variable of PNID and HHID. But when i try to merge by matching by PNID and HHID I get an error "variables PNID HHID do not uniquely identify observations in the master data.
The master data has PNID as there is a person number (10) and (21) and (31) all live in HHID (003). SO there are many "10s" in the dataset.
How do I merge this? Is there a way to create a unique identifier for each person.
tabulate PNID
person |
number |
(char) | Freq. Percent Cum.
------------+-----------------------------------
10 | 75,228 54.30 54.30
11 | 3,107 2.24 56.54
12 | 90 0.06 56.61
13 | 5 0.00 56.61
20 | 42,989 31.03 87.64
21 | 665 0.48 88.12
22 | 42 0.03 88.15
30 | 6,590 4.76 92.90
31 | 260 0.19 93.09
32 | 11 0.01 93.10
40 | 9,247 6.67 99.77
41 | 299 0.22 99.99
42 | 14 0.01 100.00
------------+-----------------------------------
Total | 138,547 100.00
I am trying to merge data sets with many waves. Both have variable of PNID and HHID. But when i try to merge by matching by PNID and HHID I get an error "variables PNID HHID do not uniquely identify observations in the master data.
The master data has PNID as there is a person number (10) and (21) and (31) all live in HHID (003). SO there are many "10s" in the dataset.
How do I merge this? Is there a way to create a unique identifier for each person.
tabulate PNID
person |
number |
(char) | Freq. Percent Cum.
------------+-----------------------------------
10 | 75,228 54.30 54.30
11 | 3,107 2.24 56.54
12 | 90 0.06 56.61
13 | 5 0.00 56.61
20 | 42,989 31.03 87.64
21 | 665 0.48 88.12
22 | 42 0.03 88.15
30 | 6,590 4.76 92.90
31 | 260 0.19 93.09
32 | 11 0.01 93.10
40 | 9,247 6.67 99.77
41 | 299 0.22 99.99
42 | 14 0.01 100.00
------------+-----------------------------------
Total | 138,547 100.00
Comment