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
Caseid variable is not available in the height-weight data for BDHS 2004 [message #514] Wed, 05 June 2013 07:37 Go to next message
m.hasan1 is currently offline  m.hasan1
Messages: 4
Registered: April 2013
Location: Brisbane, Australia
Member
Hello,

I would like to have some advice on the following:

The 2004 BDHS height-weight dataset doesn't have the key variable 'caseid' which is used to merge height-weight data with children's data. I fail to find a key variable that can be used to merge the two datasets (BDKR 2004 dataset & BDHW 2004 dataset). Can anyone please suggest how can I create the caseid variable or how can I merge the two datasets? Please note that I am using STATA.

Thanks in advance for help.
T

[Updated on: Wed, 05 June 2013 07:44]

Report message to a moderator

Re: Caseid variable is not available in the height-weight data for BDHS 2004 [message #584 is a reply to message #514] Tue, 25 June 2013 16:34 Go to previous messageGo to next message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Here is an answer from one of our experts, Alexander Izmukhambetov:

There is an ID variable "HWHHID" in the BDWH 2004 height-weight data set. This variable contains household identification for every case (cluster + household number). There is also another ID variable "HWLINE", which identifies the household line number, relating every height-weight case to a household member.
Re: Caseid variable is not available in the height-weight data for BDHS 2004 [message #3040 is a reply to message #584] Mon, 06 October 2014 16:48 Go to previous messageGo to next message
vega25 is currently offline  vega25
Messages: 14
Registered: April 2014
Location: United States
Member
In order to merge the height and weight file with the children's file for Bangladesh 2004, the merge.doc file which accompanies the height and weight file mentions:

"Use HWCASEID and HWLINE, from the Height and Weight file, with CASEID and MIDX, from the Children's recode file to merge it with the Children's data."

HWCASEID, I presume, is meant to refer to "hwhhid" which is in the height and weight file.

However, hwhhid in the height and weight file and caseid in the children's recode file do not match! What should one do?
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 next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 805
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
Re: Caseid variable is not available in the height-weight data for BDHS 2004 [message #24728 is a reply to message #3043] Wed, 29 June 2022 08:30 Go to previous messageGo to next message
Wolf is currently offline  Wolf
Messages: 2
Registered: June 2022
Member

Thanks for your help above.

Please could you update this in the merge instructions? To reflect that it is not the 'midx' variable in the child recode that is equivalent to 'HWLINE' in the new file, it is instead 'b16'.

Just to confirm, in this case I will need to drop the last digit of the 'caseID' in the child recode, and instead replace it with 'b16' so that the codes will match in both files and can then be merged together?
Re: Caseid variable is not available in the height-weight data for BDHS 2004 [message #24731 is a reply to message #24728] Wed, 29 June 2022 09:50 Go to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 805
Registered: January 2013
Senior Member
You are really creating the household ID which is the first 12 characters of the caseid (effectively dropping the woman's line number - the last 3 characters of caseid [not just the last digit]). You are the matching on the household ID and the household line number in the two datasets so that the two datasets can be merged.
Previous Topic: BHFS 2017
Next Topic: Early marriage
Goto Forum:
  


Current Time: Sat Dec 7 08:53:31 Coordinated Universal Time 2024