*************************************************************************************************** ** This program creates variables for Residences since age 12, using information ** ** in the r19 survey and previous round. ** ** ** ** Name in Program Question Name on CD Question Label ** ** ----------------- ------------------- ----------------- ** ** ** ** Created Variable: ** ** ----------------- ** ** resid CVC_TTL_RESIDENCES CVC_TTL_RESIDENCES ** ** ** ** Prior Rounds: ** ** -------------- ** ** residprev CVC_TTL_RESIDENCES CVC_TTL_RESIDENCES ** ** ** ** Current Round: ** ** -------------- ** ** y3500 YHHI-3500 VFY ADDRESS FROM DLI 2019 ** ** y3600 YHHI-3600 # DIFF ADDRESS R LIVE SDLI 2019 ** ** pubid PUBID PUBID (SYMBOL) ** *************************************************************************************************** ; SAS Code for Variable Creation resid =-4 ; if (residprev in (-1,-2,-3)) then resid=-3; if residprev ne -4 and ((y3500 in (-1,-2,-3)) or (y3600 in (-1,-2,-3))) then resid=-3; if residprev>=0 & y3500=0 then resid=residprev; if residprev>=0 & y3600>=0 then resid=residprev+y3600; label resid = "CVC_TTL_RESIDENCES"; prob1=0; if residprev=-4 & y3500 NE -5 & resid NE -4 then prob1=1; prob2=0; if residprev>resid>=0 then prob2=1; if (y3500=-5 ) then resid=residprev; prob3=0; if (residprev>=0) and resid=-4 then prob3=prob3+1; run;