/*-------------ORIGINAL CODE--------------*/ /* THIS PROGRAMME USES $_IVFIO_DV, AND POINTERS TO SIGNIFICANT OTHERS TO DERIVE $_ADRESP15_DV */ capture drop ${wave}adresp15_dv if ${cohort}== 1 { cap gen ${wave}aivfio=. cap gen ${wave}ivfio=. } gen ${wave}adresp15_dv=-9 gen age015=(inrange(${wave}age_dv,0,16)) // age group to which !-8 gen iout015=(inlist(${wave}ivfio,21,22,23,24,25,63)) // plus, if age missing replace ${wave}adresp15_dv =-8 if (age015~=1) & (iout015~=1) // R is an adult lab def ${wave}adresp15_dv -9 "missing", replace lab def ${wave}adresp15_dv -8 "inapplicable", add lab val ${wave}adresp15_dv ${wave}adresp15_dv replace ${wave}adresp15_dv =${wave}mnpno if (age015==1 | (${wave}age_dv<0 & iout015)) replace ${wave}adresp15_dv =${wave}fnpno if ${wave}adresp15_dv<=0 & (age015 | (${wave}age_dv<0 & iout015)) replace ${wave}adresp15_dv =${wave}mnspno if ${wave}adresp15_dv<=0 & (age015 | (${wave}age_dv<0 & iout015)) replace ${wave}adresp15_dv =${wave}fnspno if ${wave}adresp15_dv<=0 & (age015 | (${wave}age_dv<0 & iout015)) replace ${wave}adresp15_dv =${wave}fmpno_dv if ${wave}adresp15_dv<=0 & (age015 | (${wave}age_dv<0 & iout015)) replace ${wave}adresp15_dv =${wave}ffpno_dv if ${wave}adresp15_dv<=0 & (age015 | (${wave}age_dv<0 & iout015)) replace ${wave}adresp15_dv =${wave}grmpno if ${wave}adresp15_dv<=0 & (age015 | (${wave}age_dv<0 & iout015)) replace ${wave}adresp15_dv =${wave}grfpno if ${wave}adresp15_dv<=0 & (age015 | (${wave}age_dv<0 & iout015)) //This doesn't exist anymore past wave 5 if ${waveno} <= 5 { replace ${wave}adresp15_dv =${wave}adresp15 if ${wave}adresp15_dv<=0 & /// ${wave}adresp15>0 & (inrange(${wave}age_dv,0,15))