The DHS Program User Forum - RDF feed
https://userforum.dhsprogram.com/index.php
compute key figures
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=20111&th=9322#msg_20111
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!
]]>kepiluna22020-09-26T07:38:16-00:00Re: compute key figures
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=20135&th=9322#msg_20135
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
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.
Link: https://github.com/DHSProgram
Thank you.
Best,
Shireen Assaf
The DHS Program]]>Shireen-DHS2020-09-28T17:08:23-00:00Re: compute key figures
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=20298&th=9322#msg_20298
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