The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Egypt » Egypt Women's Status 1995 Cluster Number (Egypt Women's Status 1995 Lack of Cluster Number)
Egypt Women's Status 1995 Cluster Number [message #25464] Mon, 24 October 2022 15:34 Go to next message
lhester@hamilton.edu is currently offline  lhester@hamilton.edu
Messages: 1
Registered: October 2022
Member
Hello,

I am attempting to merge the Women's Status 1995 dataset with the Individual Recode 1995. There is no case id in the Women's Status dataset, but there is line and number. I understand that the caseid is built from the cluster number, line, and hnumber. How can I merge these datasets?

Thank you
Re: Egypt Women's Status 1995 Cluster Number [message #25469 is a reply to message #25464] Tue, 25 October 2022 09:32 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 2635
Registered: February 2013
Senior Member
Following is a response from DHS staff member, Tom Pullum:

It is easiest to do this merge using the respective variables for cluster, household, and line number. The following Stata code works for me. Good luck!

* Merge IR and WS files for Egypt 1995 DHS

* specify workspace
cd e:\DHS\DHS_data\scratch

* Prepare the WS file
use "...EGWS39FL.DTA", clear 
gen cluster=psuseg
gen hh=hnumber
sort cluster hh line
save WStemp.dta, replace

* Prepare the IR file
use "...EGIR33FL.DTA", clear 

* restrict to women who completed the women's status interview
tab swstatus
tab swstatus, nolabel
keep if swstatus==1

gen cluster=v001
gen hh=v002
gen line=v003
sort cluster hh line

* Merge the files
merge cluster hh line using WStemp.dta
tab _merge

* all cases merge ok
drop _merge

Previous Topic: Egypt DHS 2008 - Merging EGIR5AFL and EGOD5AFL
Goto Forum:
  


Current Time: Sat Dec 3 20:46:36 Coordinated Universal Time 2022