Home » Data » Merging data files » Merging the child, household and wealth file for Philippines 1998
Merging the child, household and wealth file for Philippines 1998 [message #12829] |
Wed, 19 July 2017 16:59 |
chlansangan
Messages: 6 Registered: July 2017
|
Member |
|
|
Hello,
I'm trying to merge the child, household and wealth file into one file for analysis.
What have I done so far is to use country code and phase, cluster number and household number to merge the child and household file together.
Then, I use the household id number to merge the child&household file with the wealth file.
Whenever I do this, I lose the variables I need from the wealth file. I've been working on this for a few months now and still cannot figure out what's wrong.
I've tried merging the files different ways and I still lose variables that I require to do my analysis.
Thanks,
Charmaine
[Updated on: Wed, 19 July 2017 17:20] Report message to a moderator
|
|
|
|
|
Re: Merging the child, household and wealth file for Philippines 1998 [message #12840 is a reply to message #12835] |
Fri, 21 July 2017 12:18 |
Bridgette-DHS
Messages: 3214 Registered: February 2013
|
Senior Member |
|
|
Following is a response from Senior DHS Stata Specialist, Tom Pullum:
Ok -- your original query did say 2008, not 1998.
You can merge the PR and WI files using hhid and whhid, as follows:
use e:\DHS\DHS_data\WI_files\PHWI3AFL.dta, clear
rename whhid hhid
sort hhid
save e:\DHS\DHS_data\scratch\PHtemp.dta, replace
use e:\DHS\DHS_data\PR_files\PHPR3BFL.dta, clear
sort hhid
merge hhid using e:\DHS\DHS_data\scratch\PHtemp.dta
However, the KR file for this survey does not include b16. There have been several references to b16 in other forum posts. Without b16, you cannot merge the KR and PR files. Sorry about that.
|
|
|
|
|
|
Re: Merging the child, household and wealth file for Philippines 1998 [message #12885 is a reply to message #12882] |
Fri, 28 July 2017 07:26 |
Bridgette-DHS
Messages: 3214 Registered: February 2013
|
Senior Member |
|
|
Another response from Senior DHS Stata Specialist, Tom Pullum:
The reason why you were able to merge the KR file with the HR file is that the HR file has one record per household. This is a very wide file--that is, the records are very long and each record contains information about everyone in the household. The people in the household have subscripts for their individual-level information. What you did in that merge was not very useful. The merged record for each child would have attached to it all the information about all the people in the household.
A much more useful merge, and the one I thought you were trying to do, was with the KR and PR files. The PR file is long, rather than wide, with one record for each person in the household. Each record includes information about the household as a whole, such as water and sanitation, but the individual-level information is just about the one individual. For that file you need to match b16 in the KR file with hvidx in the PR file. If you do not have b16, then you are stuck. Fortunately, this was realized about 20 years ago and the KR files since then include b16.
|
|
|
|
|
Re: Merging the child, household and wealth file for Philippines 1998 [message #12941 is a reply to message #12898] |
Wed, 16 August 2017 13:41 |
chlansangan
Messages: 6 Registered: July 2017
|
Member |
|
|
Thank you for the clarification.
However, I am still having trouble with merging the KR, HR and WI files. Whenever I merge KR and HR file, it turns out fine.
When I merge those two files together with WI, the variables in the WI files disappears (the actual variable still exist but the observations are missing or labeled in STATA as a dot).
This is also what happens when I merge the HR and WI files together, it turns out fine. When I merge those two files together with KR, variables that I need disappears.
Again, I did not have trouble doing this for 1993, only in 1998. I was able to merge the KR, HR and WI file without a problem.
|
|
|
|
Goto Forum:
Current Time: Wed Dec 25 08:48:58 Coordinated Universal Time 2024
|