The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » MERGING HIV DATASETS AND WOMEN DATASETS, DHS 2016-2017, HAITI. (DATASETS AND WOMEN DATASETS, DHS 2016-2017, HAITI.)
Re: MERGING HIV DATASETS AND WOMEN DATASETS, DHS 2016-2017, HAITI. [message #22076 is a reply to message #22075] Thu, 28 January 2021 14:30 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3203
Registered: February 2013
Senior Member

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

The Stata code to do this is given below. It shows the logic; you will have to convert to R. "_merge==3" identifies the cases that are in both files. Remember that when you use data in the AR file, you should apply the HIV weight, hiv05.

use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\HTAR71FL.DTA", clear
rename hivclust v001
rename hivnumb v002
rename hivline v003
sort v001 v002 v003
save e:\DHS\DHS_data\scratch\HTARtemp.dta, replace

use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\HTIR71FL.DTA", clear
sort v001 v002 v003
merge v001 v002 v003 using e:\DHS\DHS_data\scratch\HTARtemp.dta
tab _merge
keep if _merge==3

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Merging household and women's individual data Myanmar 2015-2016
Next Topic: coverage of variables v717 and mv717 in Mali V and VI waves
Goto Forum:
  


Current Time: Wed Dec 4 18:41:00 Coordinated Universal Time 2024