The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Kenya » Merging IR and MR Kenya 2022 (2022 KDHS) (Chronic Disease)
Re: Merging IR and MR Kenya 2022 (2022 KDHS) [message #28360 is a reply to message #28358] Wed, 20 December 2023 13:00 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3120
Registered: February 2013
Senior Member
Following is a response from Senior DHS staff member, Tom Pullum:

This is not a case-by-case merge. You need to "append" the files. The following Stata lines should work, although you may have to modify them somewhat. For example, in this survey the DV variables for women have the prefix "d", but the DV variables for men have the prefix "sdm" rather than "md", so I include a special line for them. It is possible that other variables need special re-naming.

use "KEMR8BFL", clear
gen sex=1
rename m* *
rename sdm* d*

append using "KEIR8BFL"
replace sex=2 if sex==.

label define sex 1 "Men" 2 "Women"
label values sex sex
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: KDHS 2022: Table 5.10 Age at first birth
Next Topic: Knowing the exact date of interview
Goto Forum:
  


Current Time: Mon Aug 5 17:16:49 Coordinated Universal Time 2024