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
Related Posts with Merge by person number and household ID?
Combining multiple variablesHello! I jsut started learning Stata and I am using a consensus data set and trying to combine a bu…
Control variable that varies accross time but not accros countries how to add to dataset and regressionHello everyone, For my regression i am using the VIX as a proxy for volatility and the TED spread a…
Displaying results in full form - double formatHi All, I am using the following command, in stata 13.1 total subsidyamt, over(fiscal_year1) to c…
Quintile Sorting two variablesI have monthly observations from various funds over along amount of time but the time series are unb…
Split file by group i.e. group 1 (non clinical) vs group 2 (clinical)Hi there, Might someone please advise how I split my Stata dataset by 1 variable "Group" which is h…
Subscribe to:
Post Comments (Atom)
0 Response to Merge by person number and household ID?
Post a Comment