Notes
Variable créée à partir des variables d10m_10 et d10a_10
Programme Stata :
gen sampled10= inlist(gross_r,2,3)
local i= 0
capture drop d10_r*
foreach var of newlist d10_r1 - d10_r15 {
gen `var'= mdy( d10m_`i',15,d10a_`i' ) if inrange(d10m_`i',1,12) & inrange(d10a_`i',1950,2011) & sampled10==1
replace `var'= mdy( 6,15,d10a_`i' ) if !inrange(d10m_`i',1,12) & inrange(d10a_`i',1950,2011) & sampled10==1
replace `var'= . if !inrange(d10m_`i',1,12) & !inrange(d10a_`i',1950,2011) & sampled10==1
format `var' %td
local i= `i' + 1