The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » HIV » Gambia DHS 2013
Re: Gambia DHS 2013 [message #11161 is a reply to message #11139] Fri, 11 November 2016 09:19 Go to previous messageGo to previous message
Messages: 1516
Registered: February 2013
Senior Member
A response from Dr. Tom Pullum,

Rather than comment on your steps I will just give you the lines that will accomplish what you want to do. You will need to modify the paths. I am using the old version of the merge command, which for me is less error prone than the new version. Note that in the merged file you should use hiv05 as the weight.
set more off
use e:\DHS\DHS_data\AR_files\GMAR60FL.dta, clear
rename hivclust v001
rename hivnumb v002
rename hivline v003
drop hiv01 hiv02
sort v001 v002 v003
save e:\DHS\DHS_data\scratch\GMARtemp.dta, replace

use e:\DHS\DHS_data\IR_files\GMIR60FL.dta, clear
keep v*
gen sex=2
save e:\DHS\DHS_data\scratch\GMIRtemp.dta, replace

use e:\DHS\DHS_data\MR_files\GMMR60FL.dta, clear
keep mv*
rename mv* v*
gen sex=1
append using e:\DHS\DHS_data\scratch\GMIRtemp.dta
sort v001 v002 v003
merge v001 v002 v003 using e:\DHS\DHS_data\scratch\GMARtemp.dta
tab _merge
keep if _merge==3
tab sex hiv03 [iweight=hiv05/1000000], row

Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Rwanda 2014 Children's HIV - population representative?
Next Topic: The Gambia DHS
Goto Forum:

Current Time: Tue Aug 16 00:42:53 Coordinated Universal Time 2022