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)
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: 3199
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

 
Read Message
Read Message
Previous Topic: Egypt DHS 2008 - Merging EGIR5AFL and EGOD5AFL
Next Topic: Searching Variable of Governorates
Goto Forum:
  


Current Time: Mon Nov 25 14:30:35 Coordinated Universal Time 2024