Merging variables from original DHS with IPUMS DHS [message #18989] |
Tue, 31 March 2020 09:32  |
Maemae93
Messages: 2 Registered: March 2020
|
Member |
|
|
Hello,
I am using the women's sample for Egypt downloaded from IPUM-DHS. I am trying to merge variables from the original DHS to my IPUMS DHS data. I am using the caseid variable, however, I keep getting this error on Stata: "variable caseid does not uniquely identify observations in the master data". Can you please advice on the correct way to merge these variables in?
Thank you.
|
|
|
Re: Merging variables from original DHS with IPUMS DHS [message #18991 is a reply to message #18989] |
Tue, 31 March 2020 11:20  |
Maemae93
Messages: 2 Registered: March 2020
|
Member |
|
|
I realise I have made a mistake and created the unique identifier IDHSPID. However, after trying to merge using the following code on Stata:
gen sample = string(81805)
gen str idhspid = sample + caseid
In master file:
merge 1:1 idhspid using "original DHS data"
I get the following, where the observations are not matched
Result # of obs.
-----------------------------------------
not matched 126,364
from master 106,890 (_merge==1)
from using 19,474 (_merge==2)
matched 0 (_merge==3)
|
|
|