Notes
Version corrigée de la variable e35_6, issue des réponses à la question E35.
Programme Stata :
local i=0
foreach var of newlist e35r_0r e35r_1r e35r_2r e35r_3r e35r_4r e35r_5r e35r_6r {
capture drop samplee35
gen samplee35= inlist(e34,1,2)
capture drop `var'
gen `var'= 2 - (e35r_`i'==1)
replace `var' = 997 if e35r_7==1| e35r_8==1
replace `var'=. if samplee35==0
label val `var' idemactugrosslab
tab `var' samplee35, miss
drop samplee35
local i=`i' + 1
}
local i=9
foreach var of newlist e35r_9r e35r_10r {
capture drop samplee35
gen samplee35= inlist(e34,1,2)
capture drop `var'
gen `var'= 2 - (e35r_`i'==1)
replace `var' = 997 if e35r_7==1| e35r_8==1
replace `var'=. if samplee35==0
label val `var' idemactugrosslab
tab `var' samplee35, miss
drop samplee35
local i=`i' + 1
}