The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Bangladesh » Values don't match with reported values/Antenatal care by medically trained professionals
Values don't match with reported values/Antenatal care by medically trained professionals [message #15539] Thu, 09 August 2018 04:29 Go to next message
mahmudornob is currently offline  mahmudornob
Messages: 7
Registered: August 2018
Location: South Korea
Member

Dear all,

I am a beginner in Stata (just started a couple of days ago), learning simple code. For practising, I am trying to mimic the table value of Bangladesh DHS Final Report 2014.

From table 9.1 Antenatal Care, we can see the total percentage of women taken cared by Nurse/midwife/paramedic is 3.3. However, when I use to following syntax (it seems childish), I got the value 3.48. Apart from antenatal care provided by Doctor, all the remaining variables showed little difference than the tabulated values.

can anybody help me to find out my mistakes?

Any help in this regard would be appreciated.

*********************************************
gen Doctor=.
replace Doctor=m2a_1
gen wgt=v005/1000000
tab Doctor [iweight=wgt]
gen NMFP=.
replace NMFP=1 if m2b_1==1 & m2a_1==0
replace NMFP=0 if m2b_1==0
gen wgt=v005/1000000
tab NMFP [iweight=w gt]

[Updated on: Thu, 09 August 2018 04:36]

Report message to a moderator

Re: Values don't match with reported values/Antenatal care by medically trained professionals [message #15543 is a reply to message #15539] Thu, 09 August 2018 15:55 Go to previous messageGo to next message
Mlue
Messages: 52
Registered: February 2017
Location: Cape Town
Senior Member
Hello,

Try to use the births recode... and use the attached file to help you derive the indicator you're looking for.

Mlue
Re: Values don't match with reported values/Antenatal care by medically trained professionals [message #15554 is a reply to message #15543] Sat, 11 August 2018 03:16 Go to previous messageGo to next message
mahmudornob is currently offline  mahmudornob
Messages: 7
Registered: August 2018
Location: South Korea
Member

Dear MLULEKI TSAWE,

Thank you so much for your guidelines. It seems like a complete syntax. I really did not expect that much!. I do appreciate it.

Everything seems working properly except The following code:

*=========================================================== ===================*

** DROP IF NOT WITHIN SAMPLE
qui regr m2a m2b m2c m2d m2e /*if v208 >0 & v208 !=.*/ [pw=weight]
drop if e(sample)!=1

************************************************************ ********************

In my case, it shows error (Photo attached) and perhaps, it is affecting the downstream analysis.

Would you mind to suggest me how to solve this (It seems complicated to me as I am a beginner in Stata).

I am looking forward to hearing your suggestion.

Thanking you,
Mahmudul
  • Attachment: Drop.JPG
    (Size: 28.78KB, Downloaded 34 times)
Re: Values don't match with reported values/Antenatal care by medically trained professionals [message #15555 is a reply to message #15554] Sat, 11 August 2018 04:37 Go to previous messageGo to next message
Mlue
Messages: 52
Registered: February 2017
Location: Cape Town
Senior Member
Hello Mahmudul,

Please try the code below... I have used the "keep if" command. Hopefully this will work.

Good luck...

/*
	INDIVIDUAL RECODE: BDIR72FL
	BDHS 2014

	BY: MLULEKI TSAWE - (University of the Western Cape, South Africa)

*/

clear all
set matsize 800
set mem 1g
set maxvar 9000
cd "..." // change path
use "BDBR72FL", clear
set more off

********************************************************************************

** WEIGHT VARIABLE
gen weight = v005/1000000

********************************************************************************

** SURVEY SET
gen psu =    v021
gen strata = v023
svyset psu [pw = weight], strata(strata) vce(linearized)
*svydes

********************************************************************************

// RENAME

rename v013 age
rename v106 education
rename v190 wealth
rename v025 residence
rename v024 region
*rename sdist district

////////////////////////////////////////////////////////////////////////////////

** QUALIFIED DOCTOR
recode m2a (1=1 "doctor") (0=0 "not doctor") (else=.), gen(doctor)
label var doctor "Antenatal care provided by a doctor"
label val doctor doctor

** NURSE/MIDWIFE/PARAMEDIC
cap drop NMP
gen NMP=.
replace NMP = 0 if m2b==0 | (m2a==1)
replace NMP = 1 if m2b==1 & (m2a ==0)
label define NMP 0"not NMP" 1"NMP"
label var NMP "Antenatal care provided by a nurse/midwife/paramedic"
label val NMP NMP

** FAMILY WELFARE VISITOR
cap drop FWV
gen FWV=.
replace FWV = 0 if m2c==0 | (m2a==1)
replace FWV = 1 if m2c==1 & (m2a ==0 & m2b==0)
label define FWV 0"not FWV" 1"FWV"
label var FWV "Antenatal care provided by a family welfare visitor"
label val FWV FWV

** COMMUNITY SKILLED BIRTH ATTENDANT
cap drop CSBA
gen CSBA=.
replace CSBA = 0 if m2d==0 | (m2a==1)
replace CSBA = 1 if m2d==1 & (m2a ==0 & m2b==0)
label define CSBA 0"not CSBA" 1"CSBA"
label var CSBA "Antenatal care provided by a community skilled birth attendant"
label val CSBA CSBA

** MEDICAL ASSISTANT/SUB-ASSISTANT COMMUNITY MEDICAL OFFICER (MA/SACMO)
cap drop MA_SACMO
gen MA_SACMO=.
replace MA_SACMO = 0 if m2e==0 | (m2a==1)
replace MA_SACMO = 1 if m2e==1 & (m2a ==0 & m2b==0)
label define MA_SACMO 0"not MA_SACMO" 1"MA_SACMO"
label var MA_SACMO "Antenatal care provided by a medical assistant/sub-assistant community medical officer (ma/sacmo)"
label val MA_SACMO MA_SACMO

** COMMUNITY HEALTH CARE PROVIDER
cap drop CHCP
gen CHCP=.
replace CHCP = 0 if m2f==0 | (m2a==1)
replace CHCP = 1 if m2f==1 & (m2a ==0 & m2b==0)
label define CHCP 0"not CHCP" 1"CHCP"
label var CHCP "Antenatal care provided by a community health care provider"
label val CHCP CHCP

** ========================================================================== **
** ========================================================================== **
** ========================================================================== **

** SKILLED ANTENATAL CARE PROVIDER

****** Percentage receiving antenatal care from a skilled provider

gen skilled_ANC	=	0
label define skilled_ANC 0"Unskilled" 1"Skilled provider"
label var skilled_ANC "Antenatal care from a skilled provider"
label val skilled_ANC skilled_ANC


foreach xvar of varlist m2a m2b m2c m2d m2e {
replace skilled_ANC=1 if `xvar'==1
}
*

** ANTENATAL CARE VISITS
* Replicating DHS table
cap drop antenatal_dhs
recode m14 (0=0 "None") (1=1 "1") (2=2 "2") (3=3 "3") (4/32=4 "4+") ///
(else=88 "DNK/Missing"), gen(antenatal_dhs)
label var antenatal_dhs "Antenatal visits - as in SLDHS report"
label val antenatal_dhs antenatal_dhs

* Any antenatal care
cap drop any_ANC
recode m14 (1/20=1 "Any ANC") ///
(else=0 "None/DNK/Missing"), gen(any_ANC)
label var any_ANC "Any antenatal care visit"
label val any_ANC any_ANC

*==============================================================================*

** DROP IF NOT WITHIN SAMPLE      
keep if m2a!=. | m2b!=. | m2c!=. | m2d!=. | m2e!=.

********************************************************************************

** CHECK
tab skilled_ANC [iw=weight], missing

svy: tab skilled_ANC, count format(%4.0f)
svy: tab skilled_ANC, percent format(%4.1f)
svy: tab wealth skilled_ANC, percent format(%4.1f) row miss

svy: tab antenatal_dhs residence, percent format(%4.1f) col miss

tabstat m14 if antenatal_dhs >=1 & antenatal_dhs <=4  [aw=weight], by(residence) stat(mean sd min max) format(%4.1f) long
tabstat m14 if antenatal_dhs >=1 & antenatal_dhs <=4  [aw=weight], by(age) stat(mean sd min max) format(%4.1f) long

********************************************************************************
********************************************************************************
********************************************************************************

* Mothers age at birth
cap drop agebirth
gen agebirth=(b3-v011)/12
tab agebirth

cap drop age_at_birth
recode agebirth (min/19.91667=1 "<20") (20/34.91667=2 "20-34") ///
(35/max=3 "35=49"), gen(age_at_birth)
label var age_at_birth "Mother's age at birth"
label val age_at_birth age_at_birth
svy: tab age_at_birth skilled_ANC, percent format(%4.1f) row miss

*****************************************

* Current age
recode v012 (15/19=1 "<20") (20/34=2 "20-34") (35/49=3 "35=49"), gen(age_current)
label var age_current "Current age of respondent"
label val age_current age_current

* Marital status
recode v501 (1=1 "Married") (else=0 "Not married"), gen (marital_stat)
label var marital_stat "Marital status"
label val marital_stat marital_stat

* Birth order
gen birth_order1		= 	bord
replace birth_order1	=	bord-1 if b0 == 2
replace birth_order1	=	bord-2 if b0 == 3

recode birth_order1 (1=1 "1") (2/3=2 "2-3") (4/5=3 "4-5") ///
(6/20=4 "6+"), gen(birth_order)
label var birth_order "Birth order"
label values birth_order birth_order

* Educational attainment
cap drop educ_attainment
recode v149 (0=0 "No education") (1=1 "Primary incomplete") ///
(2=2 "Primary complete") (3=3 "Secondary incomplete") ///
(4/5=4 "Secondary complete or higher"), gen(educ_attainment)
label var educ_attainment "Educational attainment"
label val educ_attainment educ_attainment

** ========================================================================== **
** ========================================================================== **
** ========================================================================== **

** READING NEWSPAPERS (at least once a week)
cap drop news_once
recode v157 (2/3=1 "Yes") (else=0 "No"), gen(news_once)
label variable news_once "Reads a newspaper at least once a week?"
label values news_once news_once

** WATCHES TV (at least once a week)
cap drop watch_tv
recode v159 (2/3=1 "Yes") (else=0 "No"), gen(watch_tv)
label variable watch_tv "Watches television at least once a week?"
label values watch_tv watch_tv

** LISTENS TO THE RADIO (at least once a week)
cap drop listen_radio
recode v158 (2/3=1 "Yes") (else=0 "No"), gen(listen_radio)
label variable listen_radio "Listens to the radio at least once a week?"
label values listen_radio listen_radio

***********************************************************

* ACCESSES ALL THREE MEDIA (at least once a week)

cap drop all_media
gen all_media = 0

foreach groupvar of varlist news_once watch_tv listen_radio {
	replace all_media=1 if (news_once==1 & watch_tv==1 & listen_radio==1)
}
*
label define all_media	0"No"  1"Yes"
label variable all_media "Accesses all three media at least once a week"
label values all_media all_media

* CEB
recode v201 (1=1 "1 child") (2/3=2 "2-3 children") ///
(4/max = 3 "4+ children"), gen (parity)
label var parity "Total number of children ever born = parity"
label val parity parity

* Region and residence = Sub-regions
cap drop sub_region
egen sub_region = group(region residence), label

*==============================================================================*
*==============================================================================*
*==============================================================================*

** MORE CHECKS **

*** Table 9.1 Antenatal care ***

svy: tab age_at_birth skilled_ANC, percent format(%4.1f) row miss

svy: tab birth_order skilled_ANC, percent format(%4.1f) row miss

svy: tab residence skilled_ANC, percent format(%4.1f) row miss

svy: tab region skilled_ANC, percent format(%4.1f) row miss

*svy: tab educ_attainment skilled_ANC, percent format(%4.1f) row miss

tab educ_attainment skilled_ANC [iw=weight], row miss nof

svy: tab wealth skilled_ANC, percent format(%4.1f) row miss

svy: tab news_once skilled_ANC, percent format(%4.1f) row

svy: tab watch_tv skilled_ANC, percent format(%4.1f) row

svy: tab listen_radio skilled_ANC, percent format(%4.1f) row

*svy: tab all_media skilled_ANC, percent format(%4.1f) row

svy: tab v130 skilled_ANC, percent format(%4.1f) row

svy: tab v501 skilled_ANC, percent format(%4.1f) row

svy: tab parity skilled_ANC, percent format(%4.1f) row

tab sub_region skilled_ANC [iw=weight], row miss nof

*svy: tab sub_region skilled_ANC, percent format(%4.1f) row

*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*
*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*

svy: tab age_at_birth skilled_ANC, count format(%4.0f) miss

svy: tab birth_order skilled_ANC, count format(%4.0f) miss

svy: tab residence skilled_ANC, count format(%4.0f) miss

svy: tab region skilled_ANC, count format(%4.0f) miss

svy: tab educ_attainment skilled_ANC, count format(%4.0f) miss

svy: tab wealth skilled_ANC, count format(%4.0f) miss

svy: tab news_once skilled_ANC, count format(%4.0f) miss

svy: tab watch_tv skilled_ANC, count format(%4.0f) miss

svy: tab listen_radio skilled_ANC, count format(%4.0f) miss

svy: tab all_media skilled_ANC, count format(%4.0f) miss

svy: tab v130 skilled_ANC, count format(%4.0f) miss

svy: tab v501 skilled_ANC, count format(%4.0f) miss

svy: tab parity skilled_ANC, count format(%4.0f) miss

svy: tab sub_region skilled_ANC, count format(%4.0f) miss

exit

********************************************************************************

svy: glm skilled_ANC ib(1).age_at_birth ib(0).marital_stat ///
ib(4).v130 ib(0).educ_attainment ib(1).wealth ib(4).birth_order ///
ib(1).parity ib(0).all_media ib(2).residence ib(1).region, family(binomial) link(logit) eform cformat(%4.1f)

svy: logistic skilled_ANC ib(1).age_at_birth ib(0).marital_stat ///
ib(4).v130 ib(0).educ_attainment ib(1).wealth ib(4).birth_order ///
ib(1).parity ib(0).all_media ib(2).residence ib(1).region, cformat(%4.1f)

/*
svy: logistic skilled_ANC age_at_birth marital_stat ///
v130 educ_attainment wealth birth_order ///
parity all_media residence region

graph bar (mean) skilled_ANC [pweight = weight], over(wealth) blabel(total, format(%6.2f)) ytitle(Average antenatal care use) by(, title(Average antenatal care use by wealth) subtitle(Differentials by residence) note(SLDHS (2013))) by(residence)
Re: Values don't match with reported values/Antenatal care by medically trained professionals [message #15562 is a reply to message #15555] Sun, 12 August 2018 03:20 Go to previous messageGo to next message
tahneiaquader is currently offline  tahneiaquader
Messages: 3
Registered: August 2018
Location: South Korea
Member
Dear Mluleki Tsawe,

First of all, I would like to thank you for sharing such a wonderful syntax with everyone. I checked with the syntax and It worked perfectly.

While using this syntax, I was increasingly interested in your research and got acquainted with one of your articles entitled "Factors influencing the use of maternal healthcare services and childhood immunization in Swaziland".

In this article, you have shown the p-values and Chi-square of the target factors (table 2) and logistic regression (Odds Ratio = OR) of factors (table 4). Interestingly, I have found that the target factors you have chosen for your article and in the syntax here are identical.

Would you mind to share your invaluable suggestion and syntax on how to perform these using the same data presented here (in the case of Bangladesh)

Your guidelines will help us all in our future research.

Thanking you,
Tahneia Quader
Hankuk University of Foreign Studies

[Updated on: Sun, 12 August 2018 03:22]

Report message to a moderator

Re: Values don't match with reported values/Antenatal care by medically trained professionals [message #15565 is a reply to message #15555] Sun, 12 August 2018 19:30 Go to previous message
mahmudornob is currently offline  mahmudornob
Messages: 7
Registered: August 2018
Location: South Korea
Member

Dear MLULEKI TSAWE,

Thank you so much. Now it works perfectly. Your syntax saved my huge time, maybe more than a couple of months. Without your help, I had to learn everything one by one. Most importantly, with this syntax, I can understand what is going on in real-time. So, it helped me a lot to learn the basics.

Thank you once again for your kind cooperations and guidelines.

Sincerely,
Mahmudul

[Updated on: Sun, 12 August 2018 19:32]

Report message to a moderator

Previous Topic: Women Employment status
Next Topic: Slight Deviation from Reported Value: BDHS 2014 place of delivery and assistance during delivery
Goto Forum:
  


Current Time: Mon Dec 17 00:51:57 Eastern Standard Time 2018