Has anyone Stata code to compute mean durations as published in "Table 5.6 Postpartum amenorrhoea, abstinence, and insusceptibility" ?

I am trying - and failing- to replicate the mean duration of postpartum insusceptibility, using the description in the guide to DHS statistics (p.75). The distribution of births and percentages I get are slightly different from the ones published, and my mean duration tends to be 1-2 months lower.

Thanks,

Bruno

]]>

I don't know of Stata code for this, but I can share the CSPro code that is used for this, and perhaps you can work it out from that code. We might also have some SPSS code - I'll check these out and send them to you.

Cheers. Trevor]]>

Michaelo ]]>

I have this for % postpartum amenorrhoeic, abstaining, and overall insusceptible

clear all

use GHKR72FL.DTA, clear

* age of child

gen months = v008-b3

* keeping young and droppin first of multipe births

keep if months <=35 & b0!=1

* //postpartum amenorrheic from most recent birth (midx=1).

gen ppa=.

replace ppa=1 if midx==1 & v405==1

replace ppa=0 if ppa==.

* //abstaining since most recent birth (midx=1).

gen abst=.

replace abst=1 if midx==1 & v406==1

replace abst=0 if abst==.

* // postpartum amenorrheic or abstaining since most recent birth (midx=1).

gen insus=.

replace insus=1 if midx==1 & (ppa==1 | abst==1)

replace insus=0 if insus==.

gen weight=v005/1000000

gen idnum = v021

gen statid =v022

svyset idnum [pw=weight], strata(statid) singleunit(scaled)

svy: mean ppa

svy: mean abst

svy: mean insus

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

To try and calculate mean time insusceptible, I referred to the Guide to DHS statistics

I assigned each person into their 2 month window and collapsed the data

gen month2=.

replace month2=0 if months==0 | months==1

replace month2=2 if months==2 | months==3

replace month2=4 if months==4 | months==5

replace month2=6 if months==6 | months==7

replace month2=8 if months==8 | months==9

replace month2=10 if months==10 | months==11

replace month2=12 if months==12 | months==13

replace month2=14 if months==14 | months==15

replace month2=16 if months==16 | months==17

replace month2=18 if months==18 | months==19

replace month2=20 if months==20 | months==21

replace month2=22 if months==22 | months==23

replace month2=24 if months==24 | months==25

replace month2=26 if months==26 | months==27

replace month2=28 if months==28 | months==29

replace month2=30 if months==30 | months==31

replace month2=32 if months==32 | months==33

replace month2=34 if months==34 | months==35

collapse (sum) ppa abst insus [aw=v005] , by(month2)

I then created a width variable:

gen width=.

replace width=.75 if _n==1

replace width=1.75 if _n==2

replace width= 2 if width==.

But like Bruno, I am still about 2 months lower than the report. Any ideas?

]]>

Thank you!]]>

What is the STATA code that I can use to replicate this table for UDHS 2016. I have read through the comments on the subject on the same issue and also looked at the DHS guide to statistics but still not making headway.

Any help with regards to the STATA code to replicate with Table using the kids/ children's record (KR) is highly appreciated.

Thank you

Elizabeth]]>

http://www.cpc.unc.edu/research/tools/data_analysis/statatutorial Thank you!]]>