The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » General » MERGING IR AND HR FILE ((Problem with STATA compilation))
Re: MERGING IR AND HR FILE [message #29095 is a reply to message #29066] Tue, 23 April 2024 13:52 Go to previous message
Janet-DHS is currently offline  Janet-DHS
Messages: 938
Registered: April 2022
Senior Member
Following is a response from DHS staff member, Tom Pullum:

Here is a Stata program to merge the PR and IR files. It differs only slightly from the one to merge the HR and PR files.

* Specify a workspace
cd e:\DHS\DHS_data\scratch
* Prepare the PR file; keep only the household-level variables
use "...IAPR7EFL.DTA", clear
* Reduce to eligible women
keep if hv117==1
gen cluster=hv001
gen hh=hv002
gen line=hvidx
save PRtemp.dta, replace
 use "...IAIR7EFL.DTA", clear
gen cluster=v001
gen hh=v002
gen line=v003
merge 1:1 cluster hh line using PRtemp.dta
* Some women were eligible but were not interviewed (nonresponse cases); drop them
tab _merge
keep if _merge==3
drop _merge 
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Regional variable v024
Next Topic: Agricultural Land ownership: Treatment of Zero values
Goto Forum:
  


Current Time: Tue Feb 18 16:12:32 Coordinated Universal Time 2025