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 messageGo to next 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)
Re: Merging variables from original DHS with IPUMS DHS [message #22957 is a reply to message #18989] Thu, 10 June 2021 18:49 Go to previous message
boyle014 is currently offline  boyle014
Messages: 78
Registered: December 2015
Location: Minneapolis
Senior Member
Dear Maemae93,

You should not have to add into IPUMS DHS any additional variables from the original DHS files. If a sample is in IPUMS DHS, our team has incorporated virtually all of its variables. If you could provide an example of a variable that you are trying to add, that would help to answer your question more specifically.

Apologies that this response is probably too late to be useful to you. I hope it will be valuable for others with similar questions.


Professor Elizabeth Boyle
Sociology & Law, University of Minnesota, USA
Principal Investigator, IPUMS-DHS
Previous Topic: Are the merging commands and results correct
Next Topic: Mismatch of number of clusters
Goto Forum:
  


Current Time: Mon Dec 30 13:54:40 Coordinated Universal Time 2024