The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Reproductive Health » Contraceptive calendar
Re: Contraceptive calendar [message #29074 is a reply to message #29043] Fri, 19 April 2024 17:00 Go to previous message
Janet-DHS is currently offline  Janet-DHS
Messages: 800
Registered: April 2022
Senior Member
Following is a response from DHS staff member, Tom Pullum:

You could get the Stata code for the calendar (vcal_1) from our GitHub site but it's simple, so I will just paste it below. You don't exactly want the number of pregnancies, but the number of completed pregnancies, which are coded with a B for a birth and T for other terminations.

There is one record with an obvious error that must be dropped.
* Births, terminations, and completed pregnancies in the calendar (the past 5 years)
 

use "...IAIR7EFL.DTA" , clear
gen B=0
gen T=0
quietly forvalues lcol=1/80 {
replace B=B+1 if substr(vcal_1,`lcol',1)=="B" & (`lcol'-v018)<60
replace T=T+1 if substr(vcal_1,`lcol',1)=="T" & (`lcol'-v018)<60
}
 

* There is one record with T=59; drop it
drop if T==59

gen P=B+T
label variable B "Births"
label variable T "Terminations"
label variable P "Pregnancies"
tab1 B T P
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Gabon 2011-2012 Abortion
Next Topic: Cervical cancer
Goto Forum:
  


Current Time: Thu Aug 15 20:25:21 Coordinated Universal Time 2024