The DHS Program User Forum - RDF feed
https://userforum.dhsprogram.com/index.php
Stata code for mean duration of insusceptibility
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=11901&th=5929#msg_11901
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
]]>schoumaker2017-02-27T22:57:47-00:00Re: Stata code for mean duration of insusceptibility
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=11981&th=5929#msg_11981
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]]>Trevor-DHS2017-03-15T13:03:00-00:00Re: Stata code for mean duration of insusceptibility
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=13576&th=5929#msg_13576
Thanks
Michaelo ]]>Michaelo2017-11-22T08:41:03-00:00Re: Stata code for mean duration of insusceptibility
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=13870&th=5929#msg_13870
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
************************************************************ ***********
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
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?
]]>kbietsch2018-01-16T20:27:03-00:00Re: Stata code for mean duration of insusceptibility
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=14678&th=5929#msg_14678
Do you still need help with this post?
Thank you!]]>Liz-DHS2018-04-27T20:58:25-00:00Re: Stata code for mean duration of insusceptibility
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=16012&th=5929#msg_16012
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]]>enansubuga2018-10-21T23:37:41-00:00Re: Stata code for mean duration of insusceptibility
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=16023&th=5929#msg_16023
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!]]>Liz-DHS2018-10-23T19:55:52-00:00