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)
Antenatal care visits by type of facilities [message #25174] Thu, 08 September 2022 17:57 Go to next message
Aamna is currently offline  Aamna
Messages: 11
Registered: May 2019
Member
Hello,

I am working on the Pakistan database (2017-2018). I am analyzing the type of facilities used by women for antenatal care. I am coding the m57 variable. I am combining them either as Private, Public, or Home. I have run the following codes but I have run into issues when I am doing regression analysis. The issue arise because some women who received antenatal care at home also visited public or private hospitals/clinics. I created a categorical variable with 3 categories (public, private, and home). In regression, home is my compersion group. In the results private is completely omitted. I do not understand where I have made the mistake. I have made changes in my codes but the problem does not resolve. The coding commands are as below. I can not understand where I am going wrong or what mistakes I have made in any way. Can you kindly help me in pointing out my mistake as well as help me with my codes? I really appreciate your help in this crucial time of mine (time sensitive due to deadlines).
Thank you

Aamna


**Ownership of Facilities (m57)
gen antenatalvisit_facility=0
foreach xvar of varlist m57a m57b m57e m57f m57g m57h m57l m57m m57n m57o m57p m57q m57s m57x{
replace antenatalvisit_facility=. if `xvar'==.
}
tab antenatalvisit_facility, mi

*Antenatal visit by private/govt/other facilities RECODE
gen antenatalvisit_public=antenatalvisit_facility
label var antenatalvisit_public "Public Facility Used For Antenatal Care Visits During Pregnancy"
label values antenatalvisit_public decision
foreach xvar of varlist m57e m57f m57g m57l {
replace antenatalvisit_public=1 if `xvar'==1 & `xvar'!= .
}
tab antenatalvisit_public, mi

gen antenatalvisit_private=antenatalvisit_facility
label var antenatalvisit_private "Private Facility Used For Antenatal Care Visits During Pregnancy"
label values antenatalvisit_private decision
foreach xvar of varlist m57m m57n m57h m57o m57p m57q m57s m57x{
replace antenatalvisit_private=1 if `xvar'==1 & `xvar'!= .
}
tab antenatalvisit_private, mi

gen antenatalvisit_home=antenatalvisit_facility
label var antenatalvisit_home "Home Used For Antenatal Care Visits During Pregnancy"
label values antenatalvisit_home decision
foreach xvar of varlist m57a m57b {
replace antenatalvisit_home=1 if `xvar'==1 & `xvar'!= .
}
tab antenatalvisit_home, mi

gen ownership=.
replace ownership=0 if antenatalvisit_home==1
replace ownership=1 if antenatalvisit_public==1
replace ownership=2 if antenatalvisit_private==1
label var ownership "Ownership of Facilities"
label values ownership ownership
tab ownership, mi
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 next message
Janet-DHS is currently offline  Janet-DHS
Messages: 911
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
Re: Antenatal care visits by type of facilities [message #25198 is a reply to message #25196] Mon, 12 September 2022 21:43 Go to previous messageGo to next message
Aamna is currently offline  Aamna
Messages: 11
Registered: May 2019
Member
Hello,

Thank you for the reply and codes. I have a few questions about the codes.

1) I am wondering why we are using the same code to generate 3 types of facilities (gen AN_home=0 if m57a_1<.)? Shouldn't it be different as m57a_1 is for the home only?
2) m57`ll'_1 is what? Is it the eleventh variable in m57 or we are creating a new one?

I ran the command and it created a table for me; however, when I put ANtype in regression then it still omitted private in results. I still have the same issue. I used the following regression code.

svy: reg antenataldetail i.facility_visits i.ANtype womage husbandage i.womedu_new i.husedu_new i.wealth womjob_skilled womjob_unskilled womjob_agri womjob_prof husjob_skilled husjob_unskilled husjob_agri husjob_prof womenworking residencearea region_isl region_sindh region_khyber region_baluchistan mobilephone finacct decisionabthealth decisionabthusbandearning needmoney distanceissue donotgoalone needpermission wifebeating tvmedia

Is there a way to work around this issue? I appreciate the help.

Sincerely,

Aamna

Re: Antenatal care visits by type of facilities [message #25230 is a reply to message #25198] Mon, 19 September 2022 16:28 Go to previous messageGo to next message
Janet-DHS is currently offline  Janet-DHS
Messages: 911
Registered: April 2022
Senior Member
Following is a response from DHS staff member Tom Pullum:

I was using "local" notation to reduce the number of lines. The line "gen AN_home=0 if m57a_1<." arbitrarily picks the "a" type to determine which women have responses to any of the m57 types. All the types (a, b, etc.) have the same number of cases in their denominators, that is, the same number of cases who have any value other than NA, which is coded ".". The cases with numerical codes (0,1, 9) are identified with "<.". You could use any of the m57 options to determine this. In `ll', "l" is the 12th letter of the alphabet, not a number. It goes with "foreach ll" and is just the index for a loop. These are Stata operations than can simplify your life.

I see that I omitted a "label define" line. After inserting that, the last three lines should be

label define ANtype 0 "Home" 1 "Public" 2 "Private"
label values ANtype ANtype
tab ANtype, m


I then get the following UNWEIGHTED distribution:

Type of |
Facilities | Freq. Percent Cum.
------------+-----------------------------------
Home | 138 0.92 0.92
Public | 2,165 14.37 15.28
Private | 4,725 31.36 46.64
. | 8,040 53.36 100.00
------------+-----------------------------------
Total | 15,068 100.00

This distribution is for women who reported any ANC care for their most recent birth. The "." or NA category includes women who did not have a live birth in the past five years AND women who did have one but received no ANC for that birth. There is a hierarchy such that, if the woman had a combination of types that included "Private" she is classified as "Private". I don't know whether that's what you want to do, but with multiple-options variables such as this you have to impose a hierarchy on the options.

So far as the problem with your regression goes, I don't know how the outcome "antenataldetail" is coded. That outcome must be some kind of a scale for you to be using OLS regression. I am guessing that the scale is defined in such a way that it is very strongly associated with the private vs not private distinction. The model may be over-determined because of that--or perhaps some of the other variables in the model are strongly associated with ANtype. At any rate, you could simplify the model and see what happens to "private" when ANtype is the only predictor and then gradually add other predictors.
Re: Antenatal care visits by type of facilities [message #25316 is a reply to message #25174] Sat, 01 October 2022 17:38 Go to previous message
Aamna is currently offline  Aamna
Messages: 11
Registered: May 2019
Member
Thank you for the help and time.

Aamna
Previous Topic: Reasons for Non-Use
Next Topic: Domestic violence and reproductive autonomy among women in Mozambique
Goto Forum:
  


Current Time: Thu Dec 26 18:53:38 Coordinated Universal Time 2024