The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » HIV » recoding v034X (line number fo husband)
Re: recoding v034X (line number fo husband) [message #9974 is a reply to message #9918] Fri, 10 June 2016 09:53 Go to previous messageGo to previous message
mm4599 is currently offline  mm4599
Messages: 3
Registered: May 2016
Location: New York
Member
Hi Trevor
Thanks for the response. Yes, I am trying to create a couples file and then, after linking HIV status info, I would like to determine if couples are discordant. I am using the 2003/04 Tanzania HIV/AIDS Indicator Survey, the 2007/08 Tanzania AIDS Indicator Survey (AIS) and the 2011/12 AIS.

The v034 variable only needed to be reshaped in the 2003/04 AIS. As you suggest, after reshaping (using the following two commands: 1) gen id = _n; 2) reshape long v034_, i(id) j(linenum), I dropped dropped the cases where v034x==. and then merged this file with the original file.

My next step is to do an individual file and HIV file merge as follows
* Step 1: open AR file
use "xxAR61FL.DTA", clear
* Step 2: rename identifying variables
renvars hivclust hivnumb hivline / v001 v002 v003
* Step 3: sort by a unique identifier which I constructed from identifying variables (v001 v002 v003) as follows uid= v001*100000 + v002*100 + v003.
sort uid
* Step 4: save results
save "xxAR61FL_mergeprep.DTA", replace
* Step 5: open IR file
use "xxCR61FL.DTA", clear
* Step 6: sort by identifying variables
sort uid
* Step 7: merge!
merge uid using "xxAR61FL_mergeprep.DTA"
* Step 8: Complete the merge
drop if _merge==2
*Step 9: Split the merged dataset into two datasets, one for women and one for men
*Step 10: Rename the added hiv variable in the female dataset to so that it is unique for women (rename hiv03 hiv03f) and unique to men in the male dataset (rename hiv03 hiv03m)

To match couples, is the next step to merge both files into one doing the merge on v001 v002 and v034? Or do you have another suggestion?
Thanks for your assistance.

Best regards


MM
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: General information on HIV and GIS
Next Topic: Bangladesh 2011 dataset
Goto Forum:
  


Current Time: Tue May 7 22:33:08 Coordinated Universal Time 2024