Home » Data » Dataset use in Stata » merging wealth index from Ethiopia DHS 2000 to women's file
merging wealth index from Ethiopia DHS 2000 to women's file [message #162] |
Wed, 20 March 2013 00:22 |
alex
Messages: 4 Registered: March 2013 Location: USA
|
Member |
|
|
Hello!
I could not figure out how to generate the id variable for merging women's data with that of the wealth index data in Ethiopia DHS 2000. There is no explanation associated with the wealth file. I tried to convert v001, v002, and v003 into concatenated binary string combinations trying to create an id variable with resemblance to the whhid in the wealth file, but to no avail. Could anyone suggest how to create the id variable in the women's data in preparation for the merge process? I am using STATA.
Many thanks,
|
|
|
|
|
|
|
|
|
|
Re: merging wealth index from Ethiopia DHS 2000 to women's file [message #13319 is a reply to message #186] |
Tue, 17 October 2017 15:58 |
acp49
Messages: 1 Registered: October 2017
|
Member |
|
|
I have recently used the "Merge_WI_onto_IR_do.txt" attachment posted on the "Re: merging wealth index from Ethiopia DHS 2000 to women's file" chain on 22 March 2013 to merge children's and wealth index data sets for certain countries. However, for the Burkina Faso 1998 data set, the cluster and household ID numbers in the children's data set do not line up with the numbers being reported in the "whhid" variable in the wealth index data set.
For the children's data set, the range for cluster ID (v001) is [1,210] and the range for household ID (v002) is [1,40]. For reference, the first part of the code listed in the provided attachment:
* whhid has 12 characters but we need to figure out how to use them
* which part is cluster id and which part is household id?
gen str1 c1=substr(whhid,1,1)
gen str1 c2=substr(whhid,2,1)
gen str1 c3=substr(whhid,3,1)
gen str1 c4=substr(whhid,4,1)
gen str1 c5=substr(whhid,5,1)
gen str1 c6=substr(whhid,6,1)
gen str1 c7=substr(whhid,7,1)
gen str1 c8=substr(whhid,8,1)
gen str1 c9=substr(whhid,9,1)
gen str1 c10=substr(whhid,10,1)
gen str1 c11=substr(whhid,11,1)
gen str1 c12=substr(whhid,12,1)
However, the returned values from this code do not match up with these cluster and household ID ranges. I have tried parsing in several different ways. Strings c1,c2,c3,c4 are empty. Then the ranges for the remaining strings are: c5 [1,2]; c6 [0,9]; c7 [0,9]; c8 [1,7]; c9 [0,9]; c10 [0,9]; c11 [1,2]; c12 [0,9]. Therefore, c5,c6,c7 is clearly the cluster ID variable, but the remaining numbers do not match the household ID or other types of ID variables.
Would it be possible to receive further assistance with determining the relevant ID variable(s) to properly merge the children's and wealth index data sets for Burkina Faso 1998?
|
|
|
Re: merging wealth index from Ethiopia DHS 2000 to women's file [message #13320 is a reply to message #162] |
Tue, 17 October 2017 18:16 |
Trevor-DHS
Messages: 803 Registered: January 2013
|
Senior Member |
|
|
The wealth index file for the Burkina Faso 1998 survey does not match to v001 and v002. Instead the variables match to the variables sdepart (departement) sconcess (concession) and snumber (household number within concession). You could extract the equivalents of these variables as follows:
gen str3 wdepart=substr(whhid,5,3)
gen str3 wconcess=substr(whhid,8,3)
gen str2 wnumber=substr(whhid,11,2)
destring wdepart, gen(sdepart)
destring wconcess, gen(sconcess)
destring wnumber, gen(snumber)
drop wdepart wconcess wnumber
However, a much simpler method is just to create whhid in the children's dataset and to merge the wealth index file to the children's dataset using:
gen str12 whhid=substr(caseid,1,12)
merge m:1 whhid using BFWI31FL.dta
|
|
|
|
|
Goto Forum:
Current Time: Tue Dec 3 08:42:54 Coordinated Universal Time 2024
|