The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » Merging variables from original DHS with IPUMS DHS
Merging variables from original DHS with IPUMS DHS [message #18989] Tue, 31 March 2020 09:32 Go to next message
Maemae93 is currently offline  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 Go to previous message
Maemae93 is currently offline  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)
Previous Topic: SPA 2012-2017 Senegal
Next Topic: STATA codes to merge women and household datasets
Goto Forum:
  


Current Time: Fri Sep 25 17:49:54 Eastern Daylight Time 2020