The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Reproductive Health » STATA recode for assistance during delivery SLDHS
Re: STATA recode for assistance during delivery SLDHS [message #11843 is a reply to message #11804] Fri, 17 February 2017 02:56 Go to previous messageGo to previous message
Mlue
Messages: 92
Registered: February 2017
Location: North West
Senior Member
HI Liz,

I figured it out... I was using the wrong dataset and wrong Stata commands/syntaxes.

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


** DEMOGRAPHIC AND HEALTH SURVEY DATA

/*
		A stata code (do file) to compute skilled birth attendant from DHS data
*/

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

*** YEAR = 2013
** SKILLED BIRTH ATTENDANTS (SBA)

********************************************************************************
** WEIGHT VARIABLE
gen weight = v005/1000000

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

** SURVEY SET
gen psu =    v021
gen strata = v022

svyset psu [pw = weight], strata(strata) vce(linearized)

keep if v208 !=0 & v208 !=.

*==============================================================================*
** DROP IF NOT WITHIN SAMPLE
qui regr m3a m3b m3c if v208 >0 & v208 !=. [pw=weight]		
drop if e(sample)!=1	

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

// RENAME


rename v190 wealth
rename v025 residence
rename v024 region

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


// GENERATING SKILLED BIRTH ATTENDANT - VARIABLE

gen skilled_birth	=	0
label define skilled_birth 0"No" 1"Yes"
label var skilled_birth "Birth delivered by skilled birth attendant"
label val skilled_birth skilled_birth


** SKILLED BIRTH ATTENDANTS

foreach xvar of varlist m3a m3b m3c {
replace skilled_birth=1 if `xvar'==1
}


// CHECK - [Yes = Percentage delivered by a skilled provider]

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

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

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

[Updated on: Fri, 17 February 2017 02:58]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: separating string variables for pregnancy complication questions
Next Topic: women's age
Goto Forum:
  


Current Time: Sun Dec 29 09:17:23 Coordinated Universal Time 2024