Home » Data » Merging data files » Merging DHS data in Stata
Re: Merging DHS data in Stata [message #71 is a reply to message #70] |
Wed, 20 February 2013 11:46 |
Bridgette-DHS
Messages: 3214 Registered: February 2013
|
Senior Member |
|
|
Here is a response from one of our STATA experts Tom Pullum, that should answer your question.
Assuming you want a single file that includes men and women, as individuals, and has the HIV data merged onto the individual records. In Stata, I would go through the following steps:
Open the IR file and construct a new variables, sex=2 (female), for all cases. Save as file 1.
Open the MR file and construct a new variable, sex=1 (male), for all cases. For all variables you need that have an mv prefix, drop the m, so the prefix becomes v. Save as file 2.
Open the AR file and change the variable names exactly as you did. Sort on v001 v002 v003. Save as file 3.
Open file 1. Then APPEND file 2 to the end of file 1, getting a file with all the men and women as observations. Sort on v001 v002 v003. Merge with file 3, on v001 v002 v003. Drop any cases with hiv05 missing (these are cases with no HIV result). Save as file 4. This will be your working file.
In file 4, the preferred weight will be hiv05, rather than v005. The cluster variable will be v001 (it is duplicated in the v020's but we always use v001). There may be a variable that is identified as a stratum variable, e.g. v022, but we recommend that you use what is identified as the domain variable, e.g. v023. If domains are not given, you can construct a domain variable for virtually all the surveys as all combinations of region and urban/rural.
I hope this helps.
Bridgette-DHS
[Updated on: Mon, 18 March 2013 09:12] Report message to a moderator
|
|
|
|
|
Merging DHS data in Stata
By: DHS user on Wed, 20 February 2013 11:45
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
By: kf2349 on Tue, 26 March 2013 16:20
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
By: Hassen on Sun, 06 May 2018 05:58
|
|
|
Re: Merging DHS data in Stata
By: caragh on Tue, 02 April 2013 18:46
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
By: owraza on Sat, 28 June 2014 20:38
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
By: owraza on Wed, 02 July 2014 07:24
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
By: owraza on Tue, 10 May 2016 15:24
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
By: owraza on Tue, 10 May 2016 20:33
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
By: phres110 on Wed, 02 November 2016 13:29
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in SPSS
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
|
|
|
Re: Merging DHS data in Stata
By: pie on Tue, 02 June 2020 06:21
|
|
|
Re: Merging DHS data in Stata
|
Goto Forum:
Current Time: Wed Dec 25 09:49:19 Coordinated Universal Time 2024
|