The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Nutrition and Anthropometry » Merging NFHS4 files
Merging NFHS4 files [message #17862] Fri, 28 June 2019 01:48
Archana is currently offline  Archana
Messages: 4
Registered: March 2019
Member
I have merged MR,IR and PR files to study BMI, height and weight of men and women. But only 10% of the observations are merged.
I have used the following codes for merging.

use "C:\Dissertation\NFHS 4\Individual\IRnew.dta",clear
rename v001 hv001
rename v002 hv002
rename v003 hvidx
save "C:\Dissertation\NFHS 4\Individual\IRtemp.dta",replace
use "C:\Dissertation\NFHS 4\Men's\MRnew.dta",clear
rename mv* v*
rename v001 hv001
rename v002 hv002
rename v003 hvidx
save "C:\Dissertation\NFHS 4\Men's\MRtemp.dta",replace
use "C:\Dissertation\NFHS 4\Individual\IRtemp.dta",clear
append using "C:\Dissertation\NFHS 4\Men's\MRtemp.dta"
sort hv001 hv002 hvidx
save "C:\Dissertation\NFHS 4\IR_MRtemp.dta",replace
use "C:\Dissertation\NFHS 4\HouseholdNumber\PRnew.dta",clear
sort hv001 hv002 hvidx
save "C:\Dissertation\NFHS 4\HouseholdNumber\PRtemp.dta",replace
merge 1:m hv001 hv002 hvidx using "C:\Dissertation\NFHS 4\IR_MRtemp.dta"

Please let me know where am I going wrong!
Previous Topic: Stata Code for infant and young child feeding practices
Next Topic: Co-occurrence of stunting & anemia, Stunting & overweight & obese among under five children
Goto Forum:
  


Current Time: Mon Jul 22 08:57:53 Eastern Daylight Time 2019