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: 65
Registered: May 2013
Location: Belgium
Senior 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: 787
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: 15
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 messageGo to next message
kbietsch is currently offline  kbietsch
Messages: 14
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?
Re: Stata code for mean duration of insusceptibility [message #14678 is a reply to message #13870] Fri, 27 April 2018 16:58 Go to previous messageGo to next message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Dear User,
Do you still need help with this post?
Thank you!
Re: Stata code for mean duration of insusceptibility [message #16012 is a reply to message #14678] Sun, 21 October 2018 19:37 Go to previous messageGo to next message
enansubuga is currently offline  enansubuga
Messages: 3
Registered: January 2017
Location: Uganda
Member
I am trying to replicate Table 5.6 of the Uganda DHS but am not making any headway.

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
Re: Stata code for mean duration of insusceptibility [message #16023 is a reply to message #16012] Tue, 23 October 2018 15:55 Go to previous message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Dear User, Please refer to The Guide to DHS Statistics . There is a section in the manual about this topic. You can also search the DHS User Forum for Key words to find posts on this topic. Please share your code with the user community on the forum and someone may be able to help. For help with Stata, please visit,
http://www.cpc.unc.edu/research/tools/data_analysis/statatutorial Thank you!
Previous Topic: Assisted Reproductive Technology and multiple births
Next Topic: Vaginal rings for current contraception in V312
Goto Forum:
  


Current Time: Thu Mar 28 19:36:08 Coordinated Universal Time 2024