The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Child Health » merging HR and KR files and weighitng for analysis
Re: merging HR and KR files and weighitng for analysis [message #27018 is a reply to message #26998] Mon, 12 June 2023 09:20 Go to previous messageGo to previous message
Janet-DHS is currently offline  Janet-DHS
Messages: 787
Registered: April 2022
Senior Member
Following is a response from DHS staff member, Tom Pullum:

You are on the right track. Below I will post a modification of how you were doing the merge. You can save the temp file as you did--I just prefer to save it differently.

I recalculate age in single years at the time of the birth, using the cmc (century month code) for when the child was born minus the cmc for when the mother was born, dividing by 12, and converting an integer . v013 is age in five-year intervals and at the time of the survey, not the time of the birth. You can recode to intervals of age as you wish.

The sample weight variable to use is v005. This is the weight for the mother and it is used for her children. It is approximately proportional to hv005 but is adjusted for women's nonresponse.

The cases in the IR file are women. The cases in the KR file are children. The numbers of cases in the two files are different. The number of mothers is less than the number of women but more than the number of children. So the numbers you gave are ok.

Here are Stata lines that will do the merge. Let us know if you have other questions.

* specify a workspace
cd e:\DHS\DHS_data\scratch

use hv001 hv002 hv226 hv241 hv252 using "...RWHR81FL.DTA", clear

rename hv001 cluster
rename hv002 hh
sort cluster hh
save RWHRtemp.dta, replace

use "...RWKR81FL.DTA", clear
rename v001 cluster
rename v002 hh
gen mo_age_at_birth=int((b3-v011)/12)
sort cluster hh
merge m:1 cluster hh using RWHRtemp.dta
tab _merge

* _merge=2 for households with no children in the KR file
keep if _merge==3
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Maternal Mortality
Next Topic: Geospatial analysis
Goto Forum:
  


Current Time: Wed Jul 31 22:15:10 Coordinated Universal Time 2024