*************************************************************************************************** ** This program creates variables for Residences since age 12, using information ** ** in the r20 survey and previous round. ** ** ** ** Name in Program Question Name 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 2021 ** ** y3600 YHHI-3600 # DIFF ADDRESS R LIVE SDLI 2021 ** ** pubid PUBID PUBID (SYMBOL) ** ***************************************************************************************************; resid =-4 ; /* Invalid responese. */ 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; /* refusal, don't know in Current Round and in DLI round non-parent and refusal, don't know*/ /* we have valid answers in previous and current round. */ if residprev>=0 & y3500=0 then resid=residprev; /* Did not move since DLI; */ if residprev>=0 & y3600>=0 then resid=residprev+y3600; /* Moved since DLI; */ label resid = "CVC_TTL_RESIDENCES"; /* Check whether Respondents who have been interviewed in the Current Round but whose parents were not interviewed in Round 1 get RESID=-4. If they do not then prob1=1 - these prob1=1 cases generally have their resid=-4. */ prob1=0; if residprev=-4 & y3500 NE -5 & resid NE -4 then prob1=1; /* Check if RESID ever flips over the rounds. If so then prob2=1; */ prob2=0; if residprev>resid>=0 then prob2=1; /* non interview */ if (y3500=-5 ) then resid=residprev; /* prob3 flag if they have positive answers previously, but becomes '-4' in later rounds*/ prob3=0; if (residprev>=0) and resid=-4 then prob3=prob3+1; *if (prob3 NE 0) then resid = -3; *****Edited total of residences; resid_edt =-4; if resid_edtprev in (-1,-2,-3) then resid_edt=-3; if resid_edtprev ne -4 and ((y3500 in (-1,-2,-3)) or (y3600 in (-1,-2,-3))) then resid_edt=-3; if resid_edtprev>=0 & y3500=0 then resid_edt=resid_edtprev; /* Did not move since DLI; */ if resid_edtprev>=0 & y3600>=0 then resid_edt=resid_edtprev+y3600; /* Moved since DLI; */ if (y3500=-5) then resid_edt=resid_edtprev; rename resid=CVC_TTL_RESIDENCES resid_edt=CVC_TTL_RESIDENCES_EDT;