The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Reproductive Health » Merging (Pooling Colombian MR and IR datasets)
Merging [message #27724] Tue, 26 September 2023 15:41 Go to next message
Deidi is currently offline  Deidi
Messages: 14
Registered: March 2021
Member
Good afternoon,

I would like some guidance on how to pool the Colombian MR and IR files. This is to a multi-level analysis, specifically for looking at clustered reference groups that include gender differences.

Thanks in advance,

Best,

Deidi
Re: Merging [message #27736 is a reply to message #27724] Wed, 27 September 2023 09:32 Go to previous messageGo to next message
Janet-DHS is currently offline  Janet-DHS
Messages: 880
Registered: April 2022
Senior Member
Thank you for submitting your question. Could you please provide some more detailed information so we can better advise you?

Can you let us know:

• Which survey you are using (Include country name and year)?
• Which data files you are referring to?
• Which software you are using (Stata, SPSS, R, etc.)?

If you are trying to match a Table in a final report, please also indicate which table and which estimate you are trying to match.
Re: Merging [message #27737 is a reply to message #27736] Wed, 27 September 2023 09:37 Go to previous messageGo to next message
Deidi is currently offline  Deidi
Messages: 14
Registered: March 2021
Member
Good morning.

Thank for following up.

• Which survey you are using (Include country name and year)? Colombia, 2015.
• Which data files you are referring to? COIR72FL and COMR71FL
• Which software you are using (Stata, SPSS, R, etc.)? Stata.

Thank you again!

Best,

Deidi
Re: Merging [message #27738 is a reply to message #27737] Wed, 27 September 2023 13:20 Go to previous messageGo to next message
Janet-DHS is currently offline  Janet-DHS
Messages: 880
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.
Re: Merging [message #27739 is a reply to message #27738] Wed, 27 September 2023 13:22 Go to previous message
Deidi is currently offline  Deidi
Messages: 14
Registered: March 2021
Member
Thank you very much! This is super helpful.I appreciate it.

Best,

Deidi
Previous Topic: Treating datasets with an LBW infant
Next Topic: Kenya 2022 calendar data
Goto Forum:
  


Current Time: Wed Nov 13 05:05:47 Coordinated Universal Time 2024