The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Duration of Pregnancy (b20 or b21)
Re: Duration of Pregnancy [message #29294 is a reply to message #29288] Thu, 23 May 2024 08:38 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3117
Registered: February 2013
Senior Member
Following is a response from Senior DHS Staff members, Tom Pullum and Trevor Croft:

b20 is a recode of b21. b21 is one of many three-digit DHS variables that are coded as a combination of units (the first digit) and number (the next two digits). The first digit is 1 for weeks and 2 for months. To see how b20 is constructed as a recode of b21, I recommend that you open the BR file and enter "tab b21, summarize(b20)". You will get a list showing the correspondence between b20, which is interpreted as completed months, and b21, which can be either weeks or months.

Thus, b21 is in weeks or months, and it is converted to b20, in months. If you want completed weeks, you will have some slippage--that is, some ambiguity. The way we measure time could be a boring topic for some people, but for demographers it is both fascinating and a nightmare. A month has an average of 365.25/12 = 30.4375 days. A week has 7 days, so there are 30.4375/7 = 4.35 weeks in a month. Unfortunately, 4.35 is not 4. If you look at the results of "tab b21, summarize(b20)", or "tab p21, summarize(p20)" in the NR file, you will see that months 7 and 8 have 4 weeks, but month 9 has 5 weeks, because 4.35 is not 4.

You could estimate the number of weeks with the following lines:

tab b21, summarize(b20)
gen     unit=2 if b21<.
replace unit=1 if b21<200
gen     number=b21-200 if unit==2
replace number=b21-100 if unit==1
gen     weeks=int(4.35*number) if unit==2
replace weeks=number           if unit==1
tab b21, summarize(weeks)

In place of 4.35 you can use 365.25/84. Hope this construction is clear and hope it helps.

[Updated on: Thu, 23 May 2024 11:23]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: DHS 5 India dataset IR file-r900 error
Next Topic: Women who gave birth in the last 2 years
Goto Forum:
  


Current Time: Sun Jul 28 01:15:06 Coordinated Universal Time 2024