The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in SPSS » mean and median duration of breastfeeding
Re: mean and median duration of breastfeeding [message #641 is a reply to message #631] Fri, 19 July 2013 10:41 Go to previous messageGo to previous message
Sarah B is currently offline  Sarah B
Messages: 23
Registered: June 2013
Member
Hi Freddy,

Here's some code I wrote to match the table 6.8 in the Ethiopia 2005 data, which is the table on postpartum amenorrhea, insusceptibility and postpartum sexual abstinence. Please note that this table (and code) uses current status data, rather than recall of durations, which Shea mentions in his response.

** Use the KR data file, which contains all births in the 5 years prior to the survey
use "C:\DATA\ETKR51FL.DTA", clear
** Calculate age of the child in months
g agem=v008-b3
** generate sampling weight
g wgt = v005/1000000

**The denominator for the table = women with children <36m old.
**select only 2nd birth for multiple births -- assigned midx=1
ta b0 if agem<36 & (b0==0 | b0==2) [iw=wgt]
**note that this matches the total denominator.

**amenorrheic
g amen=0 if agem<36 & (b0==0 | b0==2)
*if currently pregnant, make not amenorrheic. Select for numerator only information from most recent birth (m6).
recode amen 0=1 if m6==96 & v213!=1 & midx==1
ta amen [iw=wgt]

**abstaining - same denominator and selections as for amenorrheic
g abst=0 if agem<36 & (b0==0 | b0==2)
recode abst 0=1 if m8==96 & v213!=1 & midx==1
ta abst [iw=wgt]

**insuceptible = amenorrheic or abstaining
g insuc = 0 if agem<36 & (b0==0 | b0==2)
recode insuc 0=1 if abst==1 | amen==1
ta insuc [iw=wgt]

**All match ET table 6.8

I hope this helps with your first question.

Cheers,
Sarah
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Creating mean regional value
Next Topic: Selecting one child per mother
Goto Forum:
  


Current Time: Fri Dec 27 16:17:02 Coordinated Universal Time 2024