The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Reproductive Health » Antenatal care visits by type of facilities (Reviewing which facilities were used by women for their antenatal care)
Re: Antenatal care visits by type of facilities [message #25196 is a reply to message #25174] Mon, 12 September 2022 17:06 Go to previous messageGo to previous message
Janet-DHS is currently offline  Janet-DHS
Messages: 720
Registered: April 2022
Senior Member
Following is a response from DHS staff member Tom Pullum:

I think the following will do what you want to do. I have simplified the variable names. The order of the lines after "impose a hierarchy" is crucial--I'm keeping the same sequence you had. I don't know where the difference from your code is; I just approached in a little differently. Hope this helps.


use "...PKIR71FL.DTA" , clear

local letters_home a b
local letters_public e f g h l
local letters_private m n o p q s x

gen AN_home=0 if m57a_1<.
foreach ll of local letters_home {
replace AN_home=1 if m57`ll'_1==1
}

gen AN_public=0 if m57a_1<.
foreach ll of local letters_public {
replace AN_public=1 if m57`ll'_1==1
}

gen AN_private=0 if m57a_1<.
foreach ll of local letters_private {
replace AN_private=1 if m57`ll'_1==1
}

tab1 AN_*

tab AN_home AN_public
* 24 cases of overlap

tab AN_home AN_private
* 33 cases of overlap

tab AN_public AN_private
* 410 cases of overlap


* Impose a hierarchy; public or private trumps home and private trumps public
gen ANtype=.
replace ANtype=0 if AN_home==1
replace ANtype=1 if AN_public==1
replace ANtype=2 if AN_private==1
label var ANtype "Type of Facilities"
label values ANtype ANtype
tab ANtype, m
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Reasons for Non-Use
Next Topic: Domestic violence and reproductive autonomy among women in Mozambique
Goto Forum:
  


Current Time: Fri May 31 19:37:07 Coordinated Universal Time 2024