The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » General » Merging datasets (Disability and women's questionnaire)
Merging datasets [message #24024] Fri, 04 February 2022 07:51 Go to next message
saha is currently offline  saha
Messages: 2
Registered: February 2022
Member
Hey,

1. I would like to know whether it is possible to identify the specific person, who has disability in the household to match women's questionnaire to that person? Meaning, that the one who has answered to women's questionnaire would be the one having the disability.

Additionally

2. I would like to know if it is possible to connect the disability in household to experienced gender based violence (from women's questionnaire)?
Re: Merging datasets [message #24027 is a reply to message #24024] Fri, 04 February 2022 11:08 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3199
Registered: February 2013
Senior Member
Following is a response from DHS Research & Data Analysis Director, Tom Pullum:

The line number is the same for all these types of data. The following lines illustrate a PR / IR merge for the latest Rwanda survey. I put the PR file first and then the IR file but the reverse order will give the same result. Note that I need a place to save the sorted PR file. Besides the hdis and d variables I only keep the hv0* and v0* variables but you can keep whatever you want.


cd e:\DHS\DHS_data\scratch

use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\RWPR81FL.DTA" , clear
keep if hv117==1
keep hv0* hvidx hdis*
gen cluster=hv001
gen hh=hv002
gen line=hvidx
sort cluster hh line
save RWPRtemp.dta, replace

use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\RWIR81FL.DTA" , clear
keep v0* d*
gen cluster=v001
gen hh=v002
gen line=v003
sort cluster hh line
merge 1:1 cluster hh line using RWPRtemp.dta

keep if _merge==3
drop _merge
Re: Merging datasets [message #24030 is a reply to message #24027] Sat, 05 February 2022 04:33 Go to previous messageGo to next message
saha is currently offline  saha
Messages: 2
Registered: February 2022
Member
Hey,
Thanks for the help.
I am using the DHS data for the first time and analyzing it with SPSS program, which is also new to me.

So I would like to get detailed info in a simple way. How can I merge the IR and PR together using SPSS, so that I can use the information about the specific person having disability, connect that person in the household and connect all the information about that person on Women's questionnaire (for example contraceptive method knowledge and usage). So in that case I would use only women respondents.

Thank you!
Re: Merging datasets [message #24038 is a reply to message #24030] Tue, 08 February 2022 09:48 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3199
Registered: February 2013
Senior Member
Following is a response from DHS Senior Analysis & Research Manager, Shireen Assaf:

We do not use SPSS but the following resources may help.

You may be able to borrow the logic from how a merge is done in Stata: https://github.com/DHSProgram/DHS-Analysis-Code/tree/main/Me rgeCode

The Guide to DHS statistics has a section on merging and includes some SPSS code: https://www.dhsprogram.com/Data/Guide-to-DHS-Statistics/inde x.htm#t=Analyzing_DHS_Data.htm&rhsearch=merge&rhhlte rm=merge&rhsyns=%20

There is an example of a merge in our SPSS code on GitHub. See the NT_main.sps file here: https://github.com/DHSProgram/DHS-Indicators-SPSS/blob/maste r/Chap11_NT/!NTmain.sps

The relevant code is given below, for merging the KR code with the HR file. You would be using different files, the IR and PR and would to rename hvidx to v003 see how this is done in Stata here: https://github.com/DHSProgram/DHS-Analysis-Code/blob/main/Me rgeCode/mergePR_toKRorIR.do

* Note: For the NT_MICRO sps file, you need to merge the KR with the HR file. 
* The merge will be performed before running any of the do files below. 

get file =  datapath + "\"+ hrdata + ".sav"
/rename (hv001=v001) (hv002=v002)
/keep v001 v002 hv234a.

save outfile = datapath + "\temp.sav".

* open KR dataset.
get file =  datapath + "\"+ krdata + ".sav".
match files
/file=*
/table= datapath + "\temp.sav"
/by v001 v002.
Previous Topic: Create a daughters' file on Stata
Next Topic: Cervical cancer Rwanda 2019
Goto Forum:
  


Current Time: Tue Nov 26 19:40:43 Coordinated Universal Time 2024