Home » Data » Merging data files » Merging HIV data with Couples recode
|
|
|
Re: Merging HIV data with Couples recode [message #1549 is a reply to message #1548] |
Wed, 12 March 2014 11:19 |
Trevor-DHS
Messages: 802 Registered: January 2013
|
Senior Member |
|
|
Hi Tewodoros
1. I recommend that you start by reading the following page: http://www.dhsprogram.com/data/Merging-Datasets.cfm
Then sort the datasets you are using according to the variables that will be used for merging:
Household (HR): sort cases by HV001 HV002.
Couple (CR): sort cases by V001 V002 V003.
HIV test results: sort cases by HIVCLUST HIVNUMB HIVLINE.
Let's next take the example of merging the household (HR) data with the couple's data. You need the following step:
match files
/file=*
/table='xxhr60fl_sorted.sav'
/rename (hv001,hv002=v001,v002)
/by v001 v002.
execute.
where xxhr60fl_sorted.sav is the sorted version of the HR dataset.
Then, let's take the example of merging the HIV test results with the couple's data. you have to do this in two steps - first the women and then the men.
For the women, we will create renamed variables with the women's test results.
match files
/file=*
/table='xxar60fl_sorted.sav'
/rename (hivclust,hivnumb,hivline,hiv01,hiv02,hiv03,hiv05=v001,v002, v003,whiv01,whiv02,whiv03,whiv05)
/by v001 v002 v003.
execute.
where xxar60fl_sorted.sav is the sorted version of the HIV test results dataset.
Now for the men, you first need to re-sort the couples data by the men's line number within the cluster and household:
sort cases by v001 v002 v034.
And finally merge the HIV test results for the men, creating separate renamed variables for the men's test results.
match files
/file=*
/table='xxar60fl_sorted.sav'
/rename (hivclust,hivnumb,hivline,hiv01,hiv02,hiv03,hiv05=v001,v002, v034,mhiv01,mhiv02,mhiv03,mhiv05)
/by v001 v002 v034.
execute.
To test the result, you need to first weight the data. For the couple's data we generally use the men's weight (mv005), however, when tabulating the HIV test results for couples, we use the HIV weight from the men's HIV test result (in this example, that is mhiv05, renamed from hiv05).
compute wgt = mhiv05/1000000.
weight by wgt.
Finally you can crosstabulate whiv03 with mhiv03 and compare the results to the table on couple's HIV status in the DHS reports.
I did this for the Zimbabwe DHS 2010-11 survey, comparing to table 14.12 in the report. See the attached example program.
2. If you follow the example above, then you will be able to select the cases where (whiv03 = 0 and mhiv03 = 1) or (whiv03 = 1 and mhiv03 = 0), i.e. where women's and men's HIV test results differed, but both were tested.
|
|
|
|
Re: Merging HIV data with Couples recode [message #1576 is a reply to message #1553] |
Fri, 14 March 2014 10:01 |
tedrigecho
Messages: 5 Registered: March 2014 Location: Ethiopia
|
Member |
|
|
Dear Trevor,
I'm back again. Your suggestions were very helpful. Now I'm able to do the merging process with understanding. However, I have some confusion on the result I'm obtaining after the merging of the data sets. As I explain myself before I'm not good at using syntax, thus I proceed the process simply using different menu buttons/just by clinking. So;
1. To merge the household (HR) data with the couple's data. I sorted using hv001,hv002,hv003 for HR and v001,v002,v003 for CR. Then after renaming hv001,hv002 = v001,v002 I merged the two data set. Saved with file name HH_CR.sav
2. To merge couple's data with HIV data. First I used HH_CR.sav as couple data to merge it with HIV data set. First I renamed the variables of HIV data sets for women(hivclust,hivnumb,hivline,hiv01,hiv02,hiv03,hiv05=v001, v002, v003,whiv01,whiv02,whiv03,whiv05). Then sort it. Finally merged with HH_CR.sav using v001,v002, v003. Finally saved the file with file name HH_CR_WHIV.save.
3 Then using the same file, I merge/add variables for Men. I mean, in this stage first I renamed variables of HIV data set for men (hivclust,hivnumb,hivline,hiv01,hiv02,hiv03,hiv05=v001,v002, v034,mhiv01,mhiv02,mhiv03,mhiv05). Then sorted both HH_CR_WHIV.save and HIV files using v001,v002,v034. Finally merged using these three variables (v001,v002,v034).
Unfortunately, when I try to do the computation for HIV discordant [(whiv003=1 & mhiv003=0)|(whiv003=0 & mhiv003=1)], HIV concordant positive(whiv003=1 & mhiv003=1), Women HIV positive discordant (whiv003=1 & mhiv003=0) and Men HIV positive discordant (whiv003=0 & mhiv003=1) it is different from EDHS report. So, here are some of my concerns;
1. Did I do something wrong in the sorting and merging steps? If so, what's it? (For instance in my case HIV discordant is 2.6% whereas in DHS report it 1.1%)
2. If not, what could be the possible solution? what shall I do?
3. One more thing, is the unit of analysis will remain the same after merging such data sets? or it will be affected because of merging process?
I hope I will not take your time too much to get your assistance. I so glade to receive your kind assistance and appreciated kindly.
Best regards,
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu Nov 7 16:47:27 Coordinated Universal Time 2024
|