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 |
Bridgette-DHS
Messages: 3199 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
|
|
|
Goto Forum:
Current Time: Fri Nov 29 18:37:34 Coordinated Universal Time 2024
|