The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Bangladesh » Caseid variable is not available in the height-weight data for BDHS 2004
Re: Caseid variable is not available in the height-weight data for BDHS 2004 [message #3043 is a reply to message #514] Mon, 06 October 2014 17:44 Go to previous messageGo to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 790
Registered: January 2013
Senior Member
Try the below:

* HHID is just the first 12 characters of CASEID, so you can use the following to construct HHID in the KR file:
gen hwhhid = substr(caseid,1,12)

* The line number variable to use is then b16 (line number from the household schedule).  
* Note that b16 is 0 if the child does not live in the household, but was a visitor. 
gen hwline = b16

* You can then merge using the following command. This uses a many to 1 merge because of the cases above that can have 0 on b16.
merge m:1 hwhhid hwline using "bdhw4jfl.dta"
* Drop the extra cases from the 'using' file that we don't want.
drop if _merge==2
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: BHFS 2017
Next Topic: Early marriage
Goto Forum:
  


Current Time: Tue Apr 30 03:14:32 Coordinated Universal Time 2024