The DHS Program User Forum      
Discussions regarding The DHS Program data and results
Home » Topics » Fertility » Stata code for mean duration of insusceptibility
Stata code for mean duration of insusceptibility [message #11901] Mon, 27 February 2017 17:57 Go to next message
schoumaker is currently offline  schoumaker
Messages: 33
Registered: May 2013
Location: Belgium
Member
Hello,

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





Bruno Schoumaker
Centre for Demographic Research
Université catholique de Louvain
Re: Stata code for mean duration of insusceptibility [message #11981 is a reply to message #11901] Wed, 15 March 2017 09:03 Go to previous messageGo to next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 544
Registered: January 2013
Senior Member
Hi 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
Re: Stata code for mean duration of insusceptibility [message #13576 is a reply to message #11981] Wed, 22 November 2017 03:41 Go to previous messageGo to next message
Michaelo is currently offline  Michaelo
Messages: 11
Registered: October 2017
Member
Thanks Trevor. I will appreciate it much if could kindly share with the SPSS codes for the computation of percentage of births for which mothers are postpartum amenorrhoeic, abstaining, and insusceptible, by number of months since birth, and mean duration. I am using the Ghana dataset and would wish to observe the patterns as per some population sub groups.
Thanks
Michaelo


MO
Re: Stata code for mean duration of insusceptibility [message #13870 is a reply to message #11901] Tue, 16 January 2018 15:27 Go to previous message
kbietsch is currently offline  kbietsch
Messages: 11
Registered: November 2015
Location: Washington, DC USA
Member

Has anyone written the stata code?

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?
Previous Topic: Fertility and marital status
Goto Forum:
  


Current Time: Wed Jan 24 06:11:23 Eastern Standard Time 2018