compute key figures [message #20111] |
Sat, 26 September 2020 03:38 |
kepiluna2
Messages: 1 Registered: 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 #20298 is a reply to message #20111] |
Tue, 20 October 2020 17:52 |
schoumaker
Messages: 66 Registered: 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
|
|
|