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
|
|
|