Merge BR & HW data [message #30613] |
Wed, 08 January 2025 10:56 |
Adetunji
Messages: 8 Registered: August 2023
|
Member |
|
|
Hi,
I have been working with KR files for a while and have successfully merged the HW files with the KR files in the older surveys to get the anthropometric dataset of children. However, I am concerned that not accounting for dead children might have biased my result. I want to check using the BR recode, but I am not sure if my code is merging correctly, as there are many unmatched files -- similar to the number when I merged KR file with HW file.
I fear that this command has dropped the dead children that I am interested in.
use "${br2003}", clear
gen hwhhid = substr(caseid,1,12)
clonevar hwline = b16
sort hwhhid hwline
merge m:1 hwhhid hwline using "${hw2003}"
keep if _merge==3
drop _merge
//Rename the anthropometric variables to make it comparable to the earlier surveys
rename hc70 hw70
rename hc71 hw71
rename hc72 hw72
rename hc73 hw73
//Save the merged dataset
save "${temp}/br_hw_2003", replace
use "${hw1990}", clear
rename hwcaseid caseid
rename hwline bidx
merge 1:1 caseid bidx using "${br1990}"
tab _merge
drop _merge
//Rename the anthropometric variables to make it comparable to the earlier surveys
rename hc70 hw70
rename hc71 hw71
rename hc72 hw72
rename hc73 hw73
//Save the merged dataset
save "${temp}/br_hw_1990", replace
Can you please advise on what to do and if this is okay?
|
|
|