The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » Merging HW and BR in Zambia 2001-02 (Merging datasets)
Merging HW and BR in Zambia 2001-02 [message #17792] Mon, 03 June 2019 10:03
hmyers is currently offline  hmyers
Messages: 1
Registered: June 2019
Member
I'm trying to merge HW and BR in the Zambia 2001-02 (Wave IV) survey. It worked perfectly for Wave II and III, but not for Wave IV for some reason. It seems that 'hwline' in the HW dataset should be between 1 and 5, but is instead between 2 and 26. Hence I am unable to match the entries in the HW dataset to those in the BR dataset. Does anyone know how this might be done?

The code I used for merging waves II and III is as follows:

foreach i in 21 31 {
cd "$ZMHW"
use "ZMHW`i'FL", replace
ren hwcaseid caseid
ren hwline bidx
sort caseid bidx
cd "$cleandata"
save "ZMHW`i'FL_clean", replace
cd "$ZMBR"
merge 1:1 caseid bidx using "ZMBR`i'FL"
drop if hc70==.|hc70==9998
}

Many thanks,

Hugh
 
Read Message
Previous Topic: How to merge DLHS 4-Village data and DLHS 4-EW data
Next Topic: How to combine male and women data for 3 rounds of DHS Pakistan?
Goto Forum:
  


Current Time: Thu Dec 19 10:56:38 Coordinated Universal Time 2024