The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Reproductive Health » Pregnancy duration
Re: Pregnancy duration [message #9503 is a reply to message #9443] Tue, 05 April 2016 14:00 Go to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 805
Registered: January 2013
Senior Member
Here is a simple set of code for getting the duration of pregnancy for each birth in the calendar (with caveats noted below). This uses the IR file:

local callen = 80
* create separate variables for every month
forvalues i = 1/`callen' {
  gen vcal1_`i' = substr(vcal_1,`i',1)
  * Calculate duration of pregnancy if there is a birth in this month
  gen vcalp_`i' = indexnot(substr(vcal_1,`i'+1,`callen'-`i'),"P") if substr(vcal_1,`i',1) == "B"
  * Note that cases with duration 0 are truncated cases where we do not know the length of the pregnancy
}

* reshape the data file into variables for each month
reshape long vcal1_ vcalp_, i(caseid) j(i)

lab var vcalp_ "Duration of pregnancy"
lab def vcalp 0 "Unknown duration"
lab val vcalp_ vcalp

* Keep only the births
keep if vcal1_ == "B"

* CMC date of birth
gen cmc=v017+80-i


You would need to match this up with the births in the birth history, which you can do using the CMC date of birth.

Two issues, though:
1) This only gets the duration of pregnancy for births and their pregnancy that are completely within the calendar. Any pregnancy starting before the calendar will not have a duration.
2) I would not trust the duration of pregnancy from the calendar calculated this way. The calendar was not designed to collect accurate duration of pregnancy. It can only be calculated in months this way and is likely to be reported as 9 months in most cases.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: birth order
Next Topic: RH Calendar for Cameroon 2011
Goto Forum:
  


Current Time: Sat Dec 28 16:52:11 Coordinated Universal Time 2024