The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Guidance regarding Gender Pooling in Liberia 2013 DHS data (Guidance regarding Gender Pooling)
Re: Guidance regarding Gender Pooling in Liberia 2013 DHS data [message #20009 is a reply to message #19994] Tue, 15 September 2020 07:23 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3214
Registered: February 2013
Senior Member

Following is a response from DHS Research & Data Analysis Director, Tom Pullum:

The following lines will do what you want. It is not necessary to merge first with the PR file. You can merge directly with the IR+MR appended file.


* Stata code to merge AR with IR+MR, Liberia LB6A


* Prepare AR for merge
use e:\DHS\DHS_data\AR_files\LBAR6AFL.dta, clear
rename hivclust v001
rename hivnumb v002
rename hivline v003

sort v001 v002 v003

save e:\DHS\DHS_data\scratch\LBARtemp.dta, replace


* Prepare MR for append
use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\LBMR6AFL.DTA", clear

* reduce the MR file to needed variables
keep mv0*
gen sex=1

* rename the mv variables
rename mv* v*

save e:\DHS\DHS_data\scratch\LBMRtemp.dta, replace


* Prepare IR

use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\LBIR6AFL.DTA", clear

* reduce the IR file to needed variables
keep v0*
gen sex=2

append using e:\DHS\DHS_data\scratch\LBMRtemp.dta
label define sex 1 "man" 2 "woman"
label values sex sex

* Merge appended file with AR

sort v001 v002 v003
merge v001 v002 v003 using e:\DHS\DHS_data\scratch\LBARtemp.dta
tab _merge


After you have mv variables in the MR file to v variables, appended the IR and MR files
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Household crowding
Next Topic: Community level variable
Goto Forum:
  


Current Time: Sat Dec 21 02:42:17 Coordinated Universal Time 2024