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?
Panel data with multiple observations per unit/time combo?This question is a bit Stata-related, a bit general panel data analysis-related. I've got a panel da…
How to compare two data which contain different time frequencies?Hi, I am trying to compare two datasets such as Bitcoin and AAPL. As you realized that Bitcoin data …
Estimation results not found with 'Coefplot'Hello, Using the user-written khb command by Ulrich Kohler and Kristian Karlson, I have decomposed …
Stata only creates 4 out of 5 quintiles?I have a continuous variable in some panel data (xtset by id and year over 5 years) that I would lik…
Unable to access Stata MP2 on UbuntuI have been using Stata on windows 10 for sometime now and recently got a laptop with Ubuntu 20.04 i…
Subscribe to:
Post Comments (Atom)
0 Response to Merge by person number and household ID?
Post a Comment