The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Reproductive Health » Merging (Pooling Colombian MR and IR datasets)
Re: Merging [message #27738 is a reply to message #27737] Wed, 27 September 2023 13:20 Go to previous messageGo to previous message
Janet-DHS is currently offline  Janet-DHS
Messages: 893
Registered: April 2022
Senior Member
Following is a response from DHS staff member, Tom Pullum:

A single file that includes both the women and men would be constructed with the "append" command. The following Stata lines should do this:

* Define a workspace
cd e:\DHS\DHS_data\scratch

use ...COMR71FL.dta, clear
gen sex=1
label define sex 1 "Male" 2 "Female"
label values sex sex

* Rename variables in the MR file to match the names on the IR file
* As a minimum, this will include the mv variables but there may be others
rename mv* v*
save COMR71temp.dta, replace

use ...COIR72FL.dta, clear
gen sex=2
append using COMR71temp.dta

save COIRMR.dta, replace

If you want a merged file, in which a woman and man in the same household are combined as a couple, you should just use the CR ("couples") file. You do not actually need to do that merge--it has already been done for you.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Treating datasets with an LBW infant
Next Topic: Kenya 2022 calendar data
Goto Forum:
  


Current Time: Thu Nov 28 13:39:37 Coordinated Universal Time 2024