The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Fertility » compute key figures
compute key figures Sat, 26 September 2020 03:38
 kepiluna2 Messages: 1Registered: September 2020 Member
Dear DHS-Team,

for my paper, I want to compute some key figures in fertility, like ASFR, parity, PPR and CFR. I use the kenian Data from 1989 - 2014. I´ve matched all KEIR to a general file and classified the women into birthcohorts. While I wanted to compute the age of the women at the particular birth (b3\$01 - V011, b3\$02 - V011, and so on), I saw that the order of birth is reverse. For example the Variable B3\$01 is not the first, but the last birth of the woman. So the age of the woman decreases from birth to birth.
Please tell me how I can reverse the order of the birth or let me know if there is an other way to calculate the age of woman at the time of the particular birth.

Thank you very much!

[Updated on: Sun, 27 September 2020 07:53] by Moderator

Report message to a moderator

Re: compute key figures [message #20135 is a reply to message #20111] Mon, 28 September 2020 13:08
 Shireen-DHS Messages: 29Registered: August 2020 Location: USA Member
Hello,

If you are trying to compute mother's age at birth (in BR or KR file) you can use the following Stata code:

* mother's age at birth (years): <20, 20-29, 30-39, 40-49
gen months_age=b3-v011
gen mo_age_at_birth=1 if months_age<20*12
replace mo_age_at_birth=2 if months_age>=20*12 & months_age<30*12
replace mo_age_at_birth=3 if months_age>=30*12 & months_age<40*12
replace mo_age_at_birth=4 if months_age>=40*12 & months_age<50*12
drop months_age

If you are looking to compute any DHS indicator listed in the Guide to DHS Statistics: https://www.dhsprogram.com/Data/Guide-to-DHS-Statistics/inde x.htm#t=Guide_to_DHS_Statistics_DHS-7.htm

Then please check our code library site on GitHub (both Stata and SPSS code is available). Please read the readme file before attempting to run any code.

Thank you.

Best,
Shireen Assaf
The DHS Program
Re: compute key figures [message #20298 is a reply to message #20111] Tue, 20 October 2020 17:52
 schoumaker Messages: 51Registered: May 2013 Location: Belgium Senior Member
Hello,
You can try this. There may be a more straightforard way, but this should work to compute age at birth for first birth (agebirth_1), second birth (ageirth_2) etc.
Best,
Bruno

**

local listbirths 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20

forval rank=1/20 {
gene agebirth_`rank'=.
foreach birth of local listbirths {
replace agebirth_`rank'=(b3_`birth'-v011)/12 if bord_`birth'==`rank'
}
}
**

Bruno Schoumaker
Centre for Demographic Research
Université catholique de Louvain
 Previous Topic: STATE LEVEL DATA
Goto Forum:

Current Time: Thu Oct 22 04:48:01 Eastern Daylight Time 2020