/*******************************start of the assest section (hhworthy)******************************************/ /* first create the components of hhworth40: real estate, loans, cars, etc. each sub-section computes one item */ /* of the total asset of the respondent and his/her spouse or partner. flag variables are created to indicate whether */ /* r/family received that asset item (flag_item in (1,2,-3) and if so, was the amount computed directly from the amount */ /* reported by respondent (flag_item=1) or was it computed from estimates given by respondent (flag_item=2), or was */ /* it unable to be computed (flag_item=-3). */ /***************************************************************************************************************************/ /* initialize the variable to housing_type= don't own, house_value = 0 */ housing_type=6 ; house_value=0 ; /****************** assets section 1: residence *************************************************/ /*if r alone or r and r's partner/spouse jointly own a residence*/ hhi4400 = -4; if (yhhi_4400a > -4) then hhi4400 = yhhi_4400a; else if (yhhi_4400x > -4) then hhi4400 = yhhi_4400x; if yhou_dlimortgage=1 or yhou_dliown2=1 or yhou_ch1 in (1 2 3 4 5) then do; flag_house=1; flagck_house=1; if hhi4400=1 then housing_type=1; else if hhi4400=12 then housing_type=2; else if hhi4400=8 then housing_type=3; else do; housing_type=9; *own but house type unknown; flag_h_type=1; end; if yhou_housevalue=1 & yhou_chhva>=0 then house_value=yhou_chhva; else if yhou_housevalue=2 & yhou_chhvb_000001>=0 & yhou_chhvb_000002>=0 then do; if yhou_chhvb_000002>=yhou_chhvb_000001 then house_value = (yhou_chhvb_000002 + yhou_chhvb_000001)/2; else house_value=-3; end; if yhou_housevalue not in (1,2) or yhou_chhva in (-1, -2) then do; if 1<=yhou_chhvc<=7 then flag_house=2; if yhou_chhvc=1 then house_value=12500; else if yhou_chhvc=2 then house_value=37500; else if yhou_chhvc=3 then house_value=75000; else if yhou_chhvc=4 then house_value=175000; else if yhou_chhvc=5 then house_value=375000; else if yhou_chhvc=6 then house_value=750000; else if yhou_chhvc=7 then house_value=1000001; end; end; if yhou_ch1 in (-1 -2 -3) or yhou_chhvb_000002 in (-1 -2 -3) or yhou_chhvb_000001 in (-1 -2 -3) or yhou_chhvc in (-1 -2 -3) then house_value=-3; if yhou_ch1 in (-1 -2 -3) then housing_type=-3; *not knowing own or not own; if (yast40_age40elig1 = 1 & yhou_ch1 in(9, 10)) then house_value=0; if yast40_age40elig1 ne 1 then do; housing_type=-4; house_value=-4; end; /*****************************assets section 2: owning business-pvbuss*********************************************/ /* asset40 skipped these questions - skipped qs adjusted for r20 */ yast40_4030a_05 = -4; yast40_4032_05 = -4; yast40_4032a_04 = -4; yast40_4032a_05 = -4; yast40_4033a_000001_03 = -4; yast40_4033a_000001_04 = -4; yast40_4033a_000001_05 = -4; yast40_4033a_000002_03 = -4; yast40_4033a_000002_04 = -4; yast40_4033a_000002_05 = -4; yast40_4034a_000001_02 = -4; yast40_4034a_000001_03 = -4; yast40_4034a_000001_04 = -4; yast40_4034a_000001_05 = -4; yast40_4034a_000002_02 = -4; yast40_4034a_000002_03 = -4; yast40_4034a_000002_04 = -4; yast40_4034a_000002_05 = -4; yast40_4036_02 = -4; yast40_4036_03 = -4; yast40_4036_04 = -4; yast40_4036_05 = -4; yast40_4036a_02 = -4; yast40_4036a_03 = -4; yast40_4036a_04 = -4; yast40_4036a_05 = -4; /**** create array for business variables because some own two businesses ****/ array pvbuss (*) pvbuss_01 - pvbuss_04; /* pv of business */ array yast40_4030a (*) yast40_4030a_01 - yast40_4030a_05; /* make, lose or even */ array yast40_4032 (*) yast40_4032_01 - yast40_4032_05; /* amount make */ array yast40_4032a (*) yast40_4032a_01 - yast40_4032a_05; /* amount lose */ array yast40_4033a_000001(*) yast40_4033a_000001_01 - yast40_4033a_000001_05; /* amount make lower bound */ array yast40_4033a_000002(*) yast40_4033a_000002_01 - yast40_4033a_000002_05; /* amount make upper bound */ array yast40_4034a_000001(*) yast40_4034a_000001_01 - yast40_4034a_000001_05; /* amount lose lower bound */ array yast40_4034a_000002(*) yast40_4034a_000002_01 - yast40_4034a_000002_05; /* amount lose upper bound */ array yast40_4036 (*) yast40_4036_01 - yast40_4036_05; /* amount make, estimate */ array yast40_4036a (*) yast40_4036a_01 - yast40_4036a_05; /* amount lose, estimate */ do i=1 to dim(pvbuss); pvbuss(i)= -4; if yast40_4010=1 then do; flag_pvbuss =1; if yast40_4030a(i)=1 then do; if yast40_4032a(i)>=0 then pvbuss(i)=yast40_4032a(i); else if yast40_4032a(i) in (-1, -2) then do; if yast40_4034a_000002(i)>=yast40_4034a_000001(i) and yast40_4034a_000002(i)>=0 and yast40_4034a_000001(i)>=0 then pvbuss(i)=(yast40_4034a_000001(i) + yast40_4034a_000002(i))/2; else pvbuss(i)=-3; end; if yast40_4034a_000002(i) in (-1, -2) then do; if 1 <= yast40_4036a(i)<=7 then flag_pvbuss=2; if yast40_4036a(i)=1 then pvbuss(i)=12500; else if yast40_4036a(i)=2 then pvbuss(i)=37500; else if yast40_4036a(i)=3 then pvbuss(i)=75000; else if yast40_4036a(i)=4 then pvbuss(i)=175000; else if yast40_4036a(i)=5 then pvbuss(i)=375000; else if yast40_4036a(i)=6 then pvbuss(i)=750000; else if yast40_4036a(i)=7 then pvbuss(i)=1000001; end; if pvbuss(i)>0 then pvbuss(i)=-1*pvbuss(i); end; else if yast40_4030a(i)=2 then do; if yast40_4032(i)>=0 then pvbuss(i)=yast40_4032(i); else if yast40_4032(i) in (-1, -2) then do; if yast40_4033a_000002(i)>=yast40_4033a_000001(i) and yast40_4033a_000002(i)>=0 and yast40_4033a_000001(i)>=0 then pvbuss(i)=(yast40_4033a_000001(i) + yast40_4033a_000002(i))/2; else pvbuss(i)=-3; end; if yast40_4033a_000002(i) in (-1, -2) then do; if 1<=yast40_4036(i)<=7 then flag_pvbuss=2; if yast40_4036(i)=1 then pvbuss(i)=12500; else if yast40_4036(i)=2 then pvbuss(i)=37500; else if yast40_4036(i)=3 then pvbuss(i)=75000; else if yast40_4036(i)=4 then pvbuss(i)=175000; else if yast40_4036(i)=5 then pvbuss(i)=375000; else if yast40_4036(i)=6 then pvbuss(i)=750000; else if yast40_4036(i)=7 then pvbuss(i)=1000001; end; end; else if yast40_4030a(i)=3 then pvbuss(i)=0; end; if yast40_4010=-1 or yast40_4030a(i)=-1 or yast40_4036a(i)=-1 or yast40_4036(i)= -1 then pvbuss(i)=-1; if yast40_4010=-2 or yast40_4030a(i)=-2 or yast40_4036a(i)=-2 or yast40_4036(i)= -2 then pvbuss(i)=-2; if yast40_4010=-3 or yast40_4030a(i)=-3 or yast40_4036a(i)=-3 or yast40_4036(i)= -3 then pvbuss(i)=-3; end; /**************************assets section 3: ownership of other real-estate : othreal**********************************/ /* asset40 skipped these questions - skipped qs adjusted for r20 */ yast40_4162n = -4; yast40_4164n_000001 = -4; yast40_4164n_000002 = -4; othreal=-4; if yast40_4140=1 then do; flag_othreal=1; if yast40_4160=1 & yast40_4162>=0 then othreal=yast40_4162; else if yast40_4160=2 & yast40_4164_000002>=0 & yast40_4164_000001>=0 then do; if yast40_4164_000002>=yast40_4164_000001 then othreal=(yast40_4164_000001+yast40_4164_000002)/2; else othreal=-3; end; else if yast40_4160=3 & yast40_4162n>=0 then othreal=-(yast40_4162n); else if yast40_4160=4 & yast40_4164n_000002>=0 & yast40_4164n_000001>=0 then do; if yast40_4164n_000002>=yast40_4164n_000001 then othreal=-(yast40_4164n_000001+yast40_4164n_000002)/2; else othreal=-3; end; *if yast40_4160 not in (1,2) or yast40_4162 in (-1, -2) then do; if yast40_4160 not in (1,2,3,4) or yast40_4162 in (-1, -2) then do; *changed in june 2013. the error should not affect the results from r14: for those with 4160 in (3,4), 4166 would be -4, so the value cal from 4162 or 4164 should not be overwritten; if 1<=yast40_4166<=7 then flag_othreal=2; if yast40_4166=1 then othreal=12500; else if yast40_4166=2 then othreal=37500; else if yast40_4166=3 then othreal=75000; else if yast40_4166=4 then othreal=175000; else if yast40_4166=5 then othreal=375000; else if yast40_4166=6 then othreal=750000; else if yast40_4166=7 then othreal=1000001; end; end; if yast40_4140 in (-1 -2 -3) or yast40_4164_000001 in (-1 -2 -3) or yast40_4164_000002 in (-1 -2 -3) or yast40_4164n_000001 in (-1 -2 -3) or yast40_4164n_000002 in (-1 -2 -3) or yast40_4166 in (-1 -2 -3) then othreal =-3; /*****************assets section 4: retirement plans or pensions--retdsav***********************************************/ retdsav=-4; if yast40_4270=1 or yast40_4000s6=1 then do; flag_retdsav=1; if yast40_4290=1 & yast40_4292>=0 then retdsav=yast40_4292; else if yast40_4290=2 and yast40_4294_000002>=0 and yast40_4294_000001>=0 then do; if yast40_4294_000002>=yast40_4294_000001 then retdsav = (yast40_4294_000001 + yast40_4294_000002)/2; else if yast40_4294_000001>=yast40_4294_000002 then retdsav = (yast40_4294_000001 + yast40_4294_000002)/2; else retdsav =-3; end; if yast40_4290 not in (1,2) or yast40_4292 in (-1, -2) then do; if 1<=yast40_4296<=8 then flag_retdsav=2; if yast40_4296=1 then retdsav=2500; else if yast40_4296=2 then retdsav= 7500; else if yast40_4296=3 then retdsav=17500; else if yast40_4296=4 then retdsav=37500; else if yast40_4296=5 then retdsav=75000; else if yast40_4296=6 then retdsav=175000; else if yast40_4296=7 then retdsav=375000; else if yast40_4296=8 then retdsav=500001; end; end; if yast40_4270 in (-1 -2 -3) or yast40_4294_000001 in (-1 -2 -3) or yast40_4294_000002 in (-1 -2 -3) or yast40_4296 in (-1 -2 -3) then retdsav=-3; /*****************assets section 5: tax advanged accounts, ira etc.--ira*************************************/ /* asset40 skipped these questions - skipped qs adjusted for r20 */ yast40_fa_8c1_03 = -4; yast40_fa_8c1_04 = -4; yast40_fa_8c1_05 = -4; yast40_fa_8c1_06 = -4; yast40_fa_8c2_03 = -4; yast40_fa_8c2_04 = -4; yast40_fa_8c2_05 = -4; yast40_fa_8c2_06 = -4; yast40_fa_8c4_01 = -4; yast40_fa_8c4_02 = -4; yast40_fa_8c4_03 = -4; yast40_fa_8c4_04 = -4; yast40_fa_8c4_05 = -4; yast40_fa_8c4_06 = -4; yast40_fa_8c4_07 = -4; array ira (*) ira_01 - ira_07; /* pv of tax ad. accts */ array ira_w (*) ira_w_01 - ira_w_07; /* withdrawl intended to pay back */ array ira_t (*) ira_t_01 - ira_t_07; /* total after intended payback withdrawl */ array yast40_fa_8a (*) yast40_fa_8a_000001 - yast40_fa_8a_000007; /* type of the accts */ array yast40_fa_8b (*) yast40_fa_8b_01 - yast40_fa_8b_07; /* withdraw or not */ array yast40_fa_8c1 (*) yast40_fa_8c1_01 - yast40_fa_8c1_07; /*amt int to payback*/ array yast40_fa_8c2 (*) yast40_fa_8c2_01 - yast40_fa_8c2_07; /* enter amt int to payback*/ array yast40_fa_8c4 (*) yast40_fa_8c4_01 - yast40_fa_8c4_07; /* estimate amt int to payback*/ array yast40_fa_8d (*) yast40_fa_8d_01 - yast40_fa_8d_07; /* ttl after pay back */ do i=1 to dim(ira); ira_w(i)=-4; ira_t(i)=-4; ira(i)= -4; if yast40_fa_8=1 then do; flag_ira =1; if yast40_fa_8a(i)=1 then do; *ira_w; if yast40_fa_8b(i)=1 then do; if yast40_fa_8c1(i)=1 & yast40_fa_8c2(i)>=0 then ira_w(i)=yast40_fa_8c2(i); else if yast40_fa_8c2(i) in(-1, -2) & yast40_fa_8c4(i) > 0 then do; if 1<=yast40_fa_8c4(i)<=7 then flag_ira=2; if yast40_fa_8c4(i)=1 then ira_w(i)=2500; else if yast40_fa_8c4(i)=2 then ira_w(i)=7500; else if yast40_fa_8c4(i)=3 then ira_w(i)=17500; else if yast40_fa_8c4(i)=4 then ira_w(i)=37500; else if yast40_fa_8c4(i)=5 then ira_w(i)=75000; else if yast40_fa_8c4(i)=6 then ira_w(i)=175000; else if yast40_fa_8c4(i)=7 then ira_w(i)=250001; end; end; else if yast40_fa_8b(i)=0 then ira_w(i)=0; else ira_w(i)=-3; *ira_t; if yast40_fa_8d(i)>=0 then ira_t(i)=yast40_fa_8d(i); else ira_t(i)=-3; *ira; if ira_w(i)>=0 & ira_t(i)>=0 then ira(i)=ira_t(i)-ira_w(i); else if ira_w(i)=-3 or ira_t(i)=-3 then ira(i)=-3; end; else if yast40_fa_8a(i) in (-1 -2 -3) then ira(i)=-3; end; if yast40_4270 in (-1 -2 -3) or yast40_fa_8 in (-1 -2 -3) then ira(i)=-3; if yast40_fa_8 in (-1 -2 -3) then ira(i)=-3; end; /**********************assets section 6: bank savings--banksav*************************************************************/ banksav=-4; if yast40_4400=1 or yast40_4000s4=1 then do; flag_banksav=1; if yast40_4420=1 & yast40_4422>=0 then banksav=yast40_4422; else if yast40_4420=2 & yast40_4424_000002>=0 & yast40_4424_000001>=0 then do; if yast40_4424_000002>=yast40_4424_000001 then banksav = (yast40_4424_000002 + yast40_4424_000001)/2; else banksav=-3; end; if yast40_4420 not in (1,2) or yast40_4422 in (-1, -2) then do; if 1<=yast40_4426<=9 then flag_banksav=2; if yast40_4426=1 then banksav=500; else if yast40_4426=2 then banksav=1750; else if yast40_4426=3 then banksav=3750; else if yast40_4426=4 then banksav=7500; else if yast40_4426=5 then banksav=17500; else if yast40_4426=6 then banksav=37500; else if yast40_4426=7 then banksav=75000; else if yast40_4426=8 then banksav=175000; else if yast40_4426=9 then banksav=250001; end; end; if yast40_4400 in (-1 -2 -3) or yast40_4424_000001 in (-1 -2 -3) or yast40_4424_000002 in (-1 -2 -3) or yast40_4426 in (-1 -2 -3) or yast40_4422=-3 then banksav=-3; /************************************assets section 7: other bank savings-bonds****************************************/ bonds=-4; if yast40_4530=1 then do; flag_bonds=1; if yast40_4550=1 & yast40_4552>=0 then bonds=yast40_4552; else if yast40_4550=2 & yast40_4554_000002>=0 & yast40_4554_000001>=0 then do; if yast40_4554_000002>=yast40_4554_000001 then bonds = (yast40_4554_000002 + yast40_4554_000001)/2; else bonds=-3; end; if yast40_4550 not in (1,2) or yast40_4552 in (-1, -2) then do; if 1<=yast40_4556<=9 then flag_bonds=2; if yast40_4556=1 then bonds=500; else if yast40_4556=2 then bonds=1750; else if yast40_4556=3 then bonds=3750; else if yast40_4556=4 then bonds=7500; else if yast40_4556=5 then bonds=17500; else if yast40_4556=6 then bonds=37500; else if yast40_4556=7 then bonds=75000; else if yast40_4556=8 then bonds=175000; else if yast40_4556=9 then bonds=250001; end; end; if yast40_4530 in (-1 -2 -3) or yast40_4554_000001 in (-1 -2 -3) or yast40_4554_000002 in (-1 -2 -3) or yast40_4556 in (-1 -2 -3) or yast40_4552=-3 then bonds=-3; /********assets section 8: owning stocks--stocks****************************************************/ stocks=-4; if yast40_4660=1 then do; flag_stocks=1; if yast40_4680=1 & yast40_4682>=0 then stocks=yast40_4682; else if yast40_4680=2 & yast40_4684_000001>=0 & yast40_4684_000002>=0 then do; if yast40_4684_000002>=yast40_4684_000001 then stocks=(yast40_4684_000001+yast40_4684_000002)/2; else stocks=-3; end; if yast40_4680 not in (1,2) or yast40_4682 in (-1,-2) then do; if 1<=yast40_4686<=9 then flag_stocks=2; if yast40_4686=1 then stocks=500; else if yast40_4686=2 then stocks=1750; else if yast40_4686=3 then stocks=3750; else if yast40_4686=4 then stocks=7500; else if yast40_4686=5 then stocks=17500; else if yast40_4686=6 then stocks=37500; else if yast40_4686=7 then stocks=75000; else if yast40_4686=8 then stocks=175000; else if yast40_4686=9 then stocks=250001; end; end; if yast40_4660 in (-1 -2 -3) or yast40_4684_000001 in (-1 -2 -3) or yast40_4684_000002 in (-1 -2 -3) or yast40_4686 in (-1 -2 -3) or yast40_4682=-3 then stocks=-3; /************assets section 9: vehicle ownership-pvcars********************************/ pvcars1=-4; if yast40_4790=1 then do; flag_pvcars1=1; if yast40_4810=1 & yast40_4812>=0 then pvcars1=yast40_4812; else if yast40_4810=2 & yast40_4814_000001>=0 & yast40_4814_000002>=0 then do; if yast40_4814_000002>=yast40_4814_000001 then pvcars1=(yast40_4814_000001+yast40_4814_000002)/2; else pvcars1=-3; end; if yast40_4810 not in (1,2) or yast40_4812 in (-1,-2) then do; if 1<=yast40_4816<=7 then flag_pvcars1=2; if yast40_4816=1 then pvcars1=2500; else if yast40_4816=2 then pvcars1=7500; else if yast40_4816=3 then pvcars1=17500; else if yast40_4816=4 then pvcars1=37500; else if yast40_4816=5 then pvcars1=75000; else if yast40_4816=6 then pvcars1=175000; else if yast40_4816=7 then pvcars1=250001; end; end; if yast40_4790 in (-1 -2 -3) or yast40_4814_000001 in (-1 -2 -3) or yast40_4814_000002 in (-1 -2 -3) or yast40_4816 in (-1 -2 -3) or yast40_4812=-3 then pvcars1=-3; /************assets section 9.2: secondary source of info on vehicle ownership, pvcars2 ********************************/ pvcars2=-4; if yast40_4000s8 =1 then do; flag_pvcars2=1; if yast40_4000s9 =1 and yast40_4000s9a>=0 then pvcars2= yast40_4000s9a; else if yast40_4000s9 = 2 and yast40_4000s9b_000001>=0 and yast40_4000s9b_000002>=0 then do; if yast40_4000s9b_000002>= yast40_4000s9b_000001 then pvcars2=(yast40_4000s9b_000002+yast40_4000s9b_000001)/2; else pvcars2=-3; end; if yast40_4000s9 not in (1,2) or yast40_4000s9a in (-1,-2) then do; if 1<= yast40_4000s9c <=8 then flag_pvcars2=2; if yast40_4000s9c=1 then pvcars2 = 500; else if yast40_4000s9c=2 then pvcars2= 1750; else if yast40_4000s9c=3 then pvcars2= 3750; else if yast40_4000s9c=4 then pvcars2= 7500; else if yast40_4000s9c=5 then pvcars2= 17500; else if yast40_4000s9c=6 then pvcars2= 37500; else if yast40_4000s9c=7 then pvcars2= 75000; else if yast40_4000s9c=8 then pvcars2= 100001; end; end; if yast40_4000s8 in (-1 -2 -3) or yast40_4000s9b_000001 in (-1 -2 -3) or yast40_4000s9b_000002 in (-1 -2 -3) or yast40_4000s9c in (-1 -2 -3) then pvcars2=-3; /*********************assets section 10: furniture value--pvfurn***************************************************/ pvfurn=-4; if yast40_4870>-4 then flag_pvfurn=1; if yast40_4870=1 then pvfurn=2500; else if yast40_4870=2 then pvfurn=7500; else if yast40_4870=3 then pvfurn=17500; else if yast40_4870=4 then pvfurn=37500; else if yast40_4870=5 then pvfurn=75000; else if yast40_4870=6 then pvfurn=175000; else if yast40_4870=7 then pvfurn=250001; else if yast40_4870=8 then pvfurn=0; else if yast40_4870=-1 then pvfurn=-1; else if yast40_4870=-2 then pvfurn=-2; else if yast40_4870=-3 then pvfurn=-3; /***********************assets section 11: other assets-othsav***************************************/ othsav=-4; if yast40_4880=1 then do; flag_othsav=1; if yast40_4900=1 & yast40_4902>=0 then othsav=yast40_4902; else if yast40_4900=2 & yast40_4904_000001>=0 & yast40_4904_000002>=0 then do; if yast40_4904_000002>=yast40_4904_000001 then othsav=(yast40_4904_000002+yast40_4904_000001)/2; else othsav=-3; end; if yast40_4900 not in (1,2) or yast40_4902 in (-1,-2) then do; if 1<=yast40_4906<=7 then flag_othsav=2; if yast40_4906=1 then othsav=2500; else if yast40_4906=2 then othsav=7500; else if yast40_4906=3 then othsav=17500; else if yast40_4906=4 then othsav=37500; else if yast40_4906=5 then othsav=75000; else if yast40_4906=6 then othsav=175000; else if yast40_4906=7 then othsav=250001; end; end; if yast40_4880=-1 or yast40_4904_000001=-1 or yast40_4904_000002=-1 or yast40_4906=-1 then othsav=-1; if yast40_4880=-2 or yast40_4904_000001=-2 or yast40_4904_000002=-2 or yast40_4906=-2 then othsav=-2; if yast40_4880=-3 or yast40_4904_000001=-3 or yast40_4904_000002=-3 or yast40_4906=-3 or yast40_4902=-3 then othsav=-3; /***************assets section 12: outstanding loans-loans****************************************/ loans=-4; if yast40_4300 in (1,2,3) then do; flag_loans=1; if yast40_4300a=1 & yast40_4300a1>=0 then loans=yast40_4300a1; else if yast40_4300a=2 & yast40_4300b_000001>=0 & yast40_4300b_000002>=0 then do; if yast40_4300b_000002>=yast40_4300b_000001 then loans=(yast40_4300b_000002+yast40_4300b_000001)/2; else loans=-3; end; if yast40_4300a not in (1,2) or yast40_4300a1 in (-1,-2) then do; if 1<=yast40_4300a2<=7 then flag_loans=2; if yast40_4300a2=1 then loans=2500; else if yast40_4300a2=2 then loans=7500; else if yast40_4300a2=3 then loans=17500; else if yast40_4300a2=4 then loans=37500; else if yast40_4300a2=5 then loans=75000; else if yast40_4300a2=6 then loans=175000; else if yast40_4300a2=7 then loans=250001; end; end; if yast40_4300=-1 or yast40_4300a2=-1 or yast40_4300b_000001=-1 or yast40_4300b_000002=-1 then loans=-1; if yast40_4300=-2 or yast40_4300a2=-2 or yast40_4300b_000001=-2 or yast40_4300b_000002=-2 then loans=-2; if yast40_4300=-3 or yast40_4300a2=-3 or yast40_4300b_000001=-3 or yast40_4300b_000002=-3 or yast40_4300a1=-3 then loans=-3; /*************************************************************; begin liabilities section ************************************************************/ /********************liabilites section 1: mortgage or land contract-mortgage************/ mortgag=-4; if yhou_dlimortgage=1 or yhou_dliown2=1 or yhou_ch1 in (1 2 3 4 5) then do; if yhou_dlimortgage=1 or yhou_ch6=1 then do; flag_mortgag=1; if yhou_ch7=1 & yhou_ch7a>=0 then mortgag=yhou_ch7a; else if yhou_ch7=2 & yhou_ch7b_000001>=0 & yhou_ch7b_000002>=0 then do; if yhou_ch7b_000002>=yhou_ch7b_000001 then mortgag = (yhou_ch7b_000001+yhou_ch7b_000002)/2; else mortgag=-3; end; if yhou_ch7 not in (1,2) or yhou_ch7a in (-1,-2) then do; if 1<=yhou_ch7c<=7 then flag_mortgag=2; if yhou_ch7c=1 then mortgag=12500; else if yhou_ch7c=2 then mortgag=37500; else if yhou_ch7c=3 then mortgag=75000; else if yhou_ch7c=4 then mortgag=175000; else if yhou_ch7c=5 then mortgag=375000; else if yhou_ch7c=6 then mortgag=750000; else if yhou_ch7c=7 then mortgag=1000001; end; end; end; if yhou_ch1 in (-1 -2 -3) or yhou_ch6 in (-1 -2 -3) or yhou_ch7b_000001 in (-1 -2 -3) or yhou_ch7b_000002 in (-1 -2 -3) or yhou_ch7c in (-1 -2 -3) then mortgag=-3; if (yast40_age40elig1 = 1 & yhou_ch1 in(9,10)) then mortgag=-4; /********************liabilities section 2: family mortgage debt-resdebt***********************/ resdebt=-4; /***********************liabilities section 3: second mortgage-othmort****************/ /* asset40 skipped these questions - skipped qs adjusted for r20 */ yhou_ch8b_000001 = -4; yhou_ch8b_000002 = -4; othmort=-4; if yhou_dlimortgage=1 or yhou_dliown2=1 or yhou_ch1 in (1 2 3 4 5) then do; if yhou_ch8=1 then do; flag_othmort=1; if yhou_ch8_1=1 & yhou_ch8a>=0 then othmort=yhou_ch8a; else if yhou_ch8_1=2 & yhou_ch8b_000002>=0 & yhou_ch8b_000001>=0 then do; if yhou_ch8b_000002>=yhou_ch8b_000001 then othmort=(yhou_ch8b_000002 + yhou_ch8b_000001)/2; else othmort=-3; end; if yhou_ch8_1 not in (1,2) or yhou_ch8a in (-1,-2) then do; if 1<=yhou_ch8c<=7 then flag_othmort=2; if yhou_ch8c=1 then othmort=12500; else if yhou_ch8c=2 then othmort=37500; else if yhou_ch8c=3 then othmort=75000; else if yhou_ch8c=4 then othmort=175000; else if yhou_ch8c=5 then othmort=375000; else if yhou_ch8c=6 then othmort=750000; else if yhou_ch8c=7 then othmort=1000001; end; end; end; if yhou_ch1 in (-1 -2 -3) or yhou_ch8 in (-1 -2 -3) or yhou_ch8b_000001 in (-1 -2 -3) or yhou_ch8b_000002 in (-1 -2 -3) or yhou_ch8c in (-1 -2 -3) then othmort=-3; if yast40_age40elig1 ne 1 then do; mortgag=-4; resdebt=-4; othmort=-4; end; if (yast40_age40elig1 = 1 & yhou_ch1 in(9,10)) then othmort=-4; /*************liabilities section 4: car debt-cardebt1*********************************/ cardebt1=-4; if yast40_4790=1 then do; flag_cardebt1=1; if yast40_4840=1 & yast40_4842>=0 then cardebt1=yast40_4842; if yast40_4840=2 and yast40_4844_000001 >=0 and yast40_4844_000002 >=0 then do; if yast40_4844_000002>= yast40_4844_000001 then cardebt1=(yast40_4844_000002+ yast40_4844_000001)/2; else cardebt1=-3; end; if yast40_4840 not in (1,2) or yast40_4842 in (-1, -2) then do; if 1 <=yast40_4846<=7 then flag_cardebt1=2; if yast40_4846=1 then cardebt1=2500; else if yast40_4846=2 then cardebt1=7500; else if yast40_4846=3 then cardebt1=17500; else if yast40_4846=4 then cardebt1=37500; else if yast40_4846=5 then cardebt1=75000; else if yast40_4846=6 then cardebt1=175000; else if yast40_4846=7 then cardebt1=250001; end; end; if yast40_4790=-1 or yast40_4844_000001=-1 or yast40_4844_000002=-1 or yast40_4846=-1 then cardebt1=-1; if yast40_4790=-2 or yast40_4844_000001=-2 or yast40_4844_000002=-2 or yast40_4846=-2 then cardebt1=-2; if yast40_4790=-3 or yast40_4844_000001=-3 or yast40_4844_000002=-3 or yast40_4846=-3 or yast40_4842=-3 then cardebt1=-3; /***************************************************************************; liabilities section 4.2: secondary info source for car debt --cardebt2 **************************************************************************/ cardebt2=-4; /* asset40 skipped these questions - skipped qs adjusted for r20 */ yast40_4000s10b_000001 = -4; yast40_4000s10b_000002 = -4; if yast40_4000s8 =1 then do; flag_cardebt2=1; if yast40_4000s10 =1 and yast40_4000s10a>=0 then cardebt2= yast40_4000s10a; else if yast40_4000s10 = 2 and yast40_4000s10b_000001>=0 and yast40_4000s10b_000002>=0 then do; if yast40_4000s10b_000002>= yast40_4000s10b_000001 then cardebt2=(yast40_4000s10b_000002+yast40_4000s10b_000001)/2; else cardebt2=-3; end; if yast40_4000s10 not in (1,2) or yast40_4000s10a in (-1,-2) then do; if 1<= yast40_4000s10c <=8 then flag_cardebt2=2; if yast40_4000s10c=1 then cardebt2= 500; else if yast40_4000s10c=2 then cardebt2= 1750; else if yast40_4000s10c=3 then cardebt2= 3750; else if yast40_4000s10c=4 then cardebt2= 7500; else if yast40_4000s10c=5 then cardebt2= 17500; else if yast40_4000s10c=6 then cardebt2= 37500; else if yast40_4000s10c=7 then cardebt2= 75000; else if yast40_4000s10c=8 then cardebt2= 100001; end; end; if yast40_4000s8=-1 or yast40_4000s10b_000001=-1 or yast40_4000s10b_000002=-1 or yast40_4000s10c=-1 then cardebt2=-1; if yast40_4000s8=-2 or yast40_4000s10b_000001=-2 or yast40_4000s10b_000002=-2 or yast40_4000s10c=-2 then cardebt2=-2; if yast40_4000s8=-3 or yast40_4000s10b_000001=-3 or yast40_4000s10b_000002=-3 or yast40_4000s10c=-3 then cardebt2=-3; /*********************liabilities section 5: personal education loan-famedudebt****************/ famedudebt=-4; if yast40_5011=1 then do; flag_famedudebt=1; if yast40_5011a=1 & yast40_5012>=0 then famedudebt=yast40_5012; else if yast40_5011a=2 & yast40_5013_000001>=0 & yast40_5013_000002>=0 then do; if yast40_5013_000002>=yast40_5013_000001 then famedudebt=(yast40_5013_000001+yast40_5013_000002)/2; else famedudebt=-3; end; if yast40_5011a not in (1,2) or yast40_5012 in (-1,-2) then do; if 1<=yast40_5014<=8 then flag_famedudebt=2; if yast40_5014=1 then famedudebt=500; else if yast40_5014=2 then famedudebt=1750; else if yast40_5014=3 then famedudebt=3750; else if yast40_5014=4 then famedudebt=7500; else if yast40_5014=5 then famedudebt=17500; else if yast40_5014=6 then famedudebt=37500; else if yast40_5014=7 then famedudebt=75000; else if yast40_5014=8 then famedudebt=100001; end; end; if yast40_5011=-1 or yast40_5013_000002=-1 or yast40_5013_000001=-1 or yast40_5014=-1 then famedudebt=-1; if yast40_5011=-2 or yast40_5013_000002=-2 or yast40_5013_000001=-2 or yast40_5014=-2 then famedudebt=-2; if yast40_5011=-3 or yast40_5013_000002=-3 or yast40_5013_000001=-3 or yast40_5014=-3 or yast40_5012=-3 then famedudebt=-3; /****************liabilities section 6: government education loan-govedudebt***************/ govedudebt=-4; if yast40_5015=1 then do; flag_govedudebt=1; if yast40_5015a=1 & yast40_5016>=0 then govedudebt=yast40_5016; else if yast40_5015a=2 & yast40_5017_000002>=0 & yast40_5017_000001>=0 then do; if yast40_5017_000002>=yast40_5017_000001 then govedudebt=(yast40_5017_000002 + yast40_5017_000001)/2; else govedudebt=-3; end; if yast40_5015a not in (1,2) or yast40_5016 in (-1,-2) then do; if 1<=yast40_5018<=8 then flag_govedudebt=2; if yast40_5018=1 then govedudebt=500; else if yast40_5018=2 then govedudebt =1750; else if yast40_5018=3 then govedudebt=3750; else if yast40_5018=4 then govedudebt=7500; else if yast40_5018=5 then govedudebt=17500; else if yast40_5018=6 then govedudebt=37500; else if yast40_5018=7 then govedudebt=75000; else if yast40_5018=8 then govedudebt=100001; end; end; if yast40_5015=-1 or yast40_5017_000002=-1 or yast40_5017_000001=-1 or yast40_5018=-1 then govedudebt=-1; if yast40_5015=-2 or yast40_5017_000002=-2 or yast40_5017_000001=-2 or yast40_5018=-2 then govedudebt=-2; if yast40_5015=-3 or yast40_5017_000002=-3 or yast40_5017_000001=-3 or yast40_5018=-3 or yast40_5016=-3 then govedudebt=-3; /****************liabilities section 6a: spouse-partner education loan***************/ sparedudebt=-4; if yast40_5040_new=1 then do; flag_sparedudebt=1; if yast40_5074_new=1 & yast40_5082_new>=0 then sparedudebt=yast40_5082_new; else if yast40_5074_new=2 & yast40_5084_000002_new>=0 & yast40_5084_000001_new>=0 then do; if yast40_5084_000002_new>=yast40_5084_000001_new then sparedudebt=(yast40_5084_000002_new + yast40_5084_000001_new)/2; else sparedudebt=-3; end; if yast40_5074_new not in (1,2) or yast40_5082_new in (-1,-2) then do; if 1<=yast40_5086_new<=8 then flag_sparedudebt=2; if yast40_5086_new=1 then sparedudebt=2500; else if yast40_5086_new=2 then sparedudebt =7500; else if yast40_5086_new=3 then sparedudebt=17500; else if yast40_5086_new=4 then sparedudebt=37500; else if yast40_5086_new=5 then sparedudebt=75000; else if yast40_5086_new=6 then sparedudebt=175000; else if yast40_5086_new=7 then sparedudebt=250001; end; end; if yast40_5040_new=-1 or yast40_5084_000002_new=-1 or yast40_5084_000001_new=-1 or yast40_5086_new=-1 then sparedudebt=-1; if yast40_5040_new=-2 or yast40_5084_000002_new=-2 or yast40_5084_000001_new=-2 or yast40_5086_new=-2 then sparedudebt=-2; if yast40_5040_new=-3 or yast40_5084_000002_new=-3 or yast40_5084_000001_new=-3 or yast40_5086_new=-3 or yast40_5082_new=-3 then sparedudebt=-3; if yast40_age40elig1=1 & sparedudebt > 0 then do; flag_sparedudebt_c=1; end; /****************liabilities section 6b: combined education loans-debt***************/ comboedudebt1=0; comboedudebt2=0; /* asset40 skipped these questions - skipped qs adjusted for r20 */ ysch_22799a_03 = -4; ysch_22799a_04 = -4; ysch_22799a_05 = -4; ysch_22799a_000001_02 = -4; ysch_22799a_000001_03 = -4; ysch_22799a_000001_04 = -4; ysch_22799a_000001_05 = -4; ysch_22799a_000002_02 = -4; ysch_22799a_000002_03 = -4; ysch_22799a_000002_04 = -4; ysch_22799a_000002_05 = -4; ysch_22799b_03 = -4; ysch_22799b_04 = -4; ysch_22799b_05 = -4; array ysch22799a ysch_22799a_01 - ysch_22799a_05; array ysch22799ar1 ysch_22799a_000001_01 - ysch_22799a_000001_05 ; array ysch22799ar2 ysch_22799a_000002_01 - ysch_22799a_000002_05 ; array ysch22799b ysch_22799b_01 - ysch_22799b_05; do over ysch22799a; if (ysch22799a in (-1 -2 -3) & ysch22799ar1>=0 & ysch22799ar2>=0) then do; if (ysch22799ar2 = ysch22799ar1) then ysch22799a_c = ysch22799ar1; else if (ysch22799ar2 - ysch22799ar1) then ysch22799a = (((ysch22799ar2 - ysch22799ar1)/2) + ysch22799ar1); else if (ysch22799ar1 - ysch22799ar2) then ysch22799a = (((ysch22799ar1 - ysch22799ar2)/2) + ysch22799ar2); end; end; do over ysch22799a; if (ysch22799a in (-1 -2 -3) & ysch22799b>0) then do; if ysch22799b=1 then ysch22799a=500; else if ysch22799b=2 then ysch22799a=1750; else if ysch22799b=3 then ysch22799a=3750; else if ysch22799b=4 then ysch22799a=7500; else if ysch22799b=5 then ysch22799a=17500; else if ysch22799b=6 then ysch22799a=37500; else if ysch22799b=7 then ysch22799a=50001; end; end; do over ysch22799a; if (yast40_age40elig1 = 1) then do; if (ysch22799a >= 0) then comboedudebt1 = (comboedudebt1 + ysch22799a); end; end; do over ysch22799a; if (ysch22799a in(-1 -2 -3)) then comboedudebt1 = ysch22799a; else if (ysch22799ar1 in(-1 -2 -3)) then comboedudebt1 = ysch22799ar1; else if (ysch22799ar2 in(-1 -2 -3)) then comboedudebt1 = ysch22799ar2; else if (ysch22799b in(-1 -2 -3)) then comboedudebt1 = ysch22799b; end; if (famedudebt >= 0) then comboedudebt2 = (comboedudebt2 + famedudebt); if (govedudebt >= 0) then comboedudebt2 = (comboedudebt2 + govedudebt); if (sparedudebt >= 0) then comboedudebt2 = (comboedudebt2 + sparedudebt); if (yast40_age40elig1=1 & famedudebt in(0, -4) & govedudebt in(0, -4) & comboedudebt1 >= 0) then do; comboedudebt2=(comboedudebt2 + comboedudebt1); end; if (famedudebt in(-1, -2, -3)) then comboedudebt2 = famedudebt; if (govedudebt in(-1, -2, -3)) then comboedudebt2 = govedudebt; if (sparedudebt in(-1, -2, -3)) then comboedudebt2 = sparedudebt; if (comboedudebt1 in(-1, -2, -3)) then comboedudebt2 = comboedudebt1; if (comboedudebt2 > 0) then flag_comboedudebt2 = 1; /**********************liabilities section 7: other debt to family or relatives--famdebt***********/ famdebt=-4; if yast40_5130=1 then do; flag_famdebt=1; if yast40_5170=1 & yast40_5172>=0 then famdebt=yast40_5172; else if yast40_5170=2 & yast40_5174_000001>=0 & yast40_5174_000002>=0 then do; if yast40_5174_000002>=yast40_5174_000001 then famdebt = (yast40_5174_000002 + yast40_5174_000001)/2; else famdebt=-3; end; if yast40_5170 not in (1,2) or yast40_5172 in (-1, -2) then do; if 1<=yast40_5176<=9 then flag_famdebt=2; if yast40_5176=1 then famdebt=500; else if yast40_5176=2 then famdebt=1750; else if yast40_5176=3 then famdebt=3750; else if yast40_5176=4 then famdebt=7500; else if yast40_5176=5 then famdebt=17500; else if yast40_5176=6 then famdebt=37500; else if yast40_5176=7 then famdebt=75000; else if yast40_5176=8 then famdebt=175000; else if yast40_5176=9 then famdebt=250001; end; end; if yast40_5130=-1 or yast40_5176=-1 or yast40_5174_000001=-1 or yast40_5174_000002=-1 then famdebt=-1; if yast40_5130=-2 or yast40_5176=-2 or yast40_5174_000001=-2 or yast40_5174_000002=-2 then famdebt=-2; if yast40_5130=-3 or yast40_5176=-3 or yast40_5174_000001=-3 or yast40_5174_000002=-3 or yast40_5172=-3 then famdebt=-3; /*****************liabilities section 7.2: second branch of 'other debt to family or relatives'--famdebt2***********/ /* Deleted obsolete code - pertained only to some oversight of data for yast20/yast25 between 9 and 10 rounds ago. See previous round programs for notes on this section. */ /************************************************************; end of liabilities section 7.2: 'other family debt' ************************************************************/ /*************************liabilities section 8: other debt--othdebt**************/ othdebt1=-4; othdebt2=-4; othdebt3=-4; if yast40_5210aa=0 | yast40_5210aa = -4 then do; flag_othdebt1=1; if yast40_5210a1=1 & yast40_5210a2>=0 then othdebt1=yast40_5210a2; else if yast40_5210a1=2 & yast40_5210a3_000002>=0 & yast40_5210a3_000001>=0 then do; if yast40_5210a3_000002>=yast40_5210a3_000001 then othdebt1= (yast40_5210a3_000002 + yast40_5210a3_000001)/2; else othdebt1=-3; end; if yast40_5210a1 not in (1,2) or yast40_5210a2 in (-1,-2) then do; if 1<=yast40_5210a4<=8 then flag_othdebt1=2; if yast40_5210a4=1 then othdebt1=500; else if yast40_5210a4=2 then othdebt1=1750; else if yast40_5210a4=3 then othdebt1=3750; else if yast40_5210a4=4 then othdebt1=7500; else if yast40_5210a4=5 then othdebt1=17500; else if yast40_5210a4=6 then othdebt1=37500; else if yast40_5210a4=7 then othdebt1=75000; else if yast40_5210a4=8 then othdebt1=100001; end; end; if yast40_5210a =-1 or yast40_5210aa=-1 or yast40_5210a3_000002=-1 or yast40_5210a3_000001=-1 or yast40_5210a4=-1 then othdebt1=-1; if yast40_5210a =-2 or yast40_5210aa=-2 or yast40_5210a3_000002=-2 or yast40_5210a3_000001=-2 or yast40_5210a4=-2 then othdebt1=-2; if yast40_5210a =-3 or yast40_5210aa=-3 or yast40_5210a3_000002=-3 or yast40_5210a3_000001=-3 or yast40_5210a4=-3 or yast40_5210a2=-3 then othdebt1=-3; if yast40_5210b1=1 then do; flag_othdebt2=1; if yast40_5210c1=1 & yast40_5210c2>=0 then othdebt2=yast40_5210c2; else if yast40_5210c1=2 & yast40_5210c3_000002>=0 & yast40_5210c3_000001>=0 then do; if yast40_5210c3_000002>=yast40_5210c3_000001 then othdebt2= (yast40_5210c3_000002 + yast40_5210c3_000001)/2; else othdebt2=-3; end; if yast40_5210c1 not in (1,2) or yast40_5210c2 in (-1, -2) then do; if 1<=yast40_5210c4<=7 then flag_othdebt2=2; if yast40_5210c4=1 then othdebt2=500; else if yast40_5210c4=2 then othdebt2=1750; else if yast40_5210c4=3 then othdebt2=3750; else if yast40_5210c4=4 then othdebt2=7500; else if yast40_5210c4=5 then othdebt2=17500; else if yast40_5210c4=6 then othdebt2=37500; else if yast40_5210c4=7 then othdebt2=50001; end; end; if yast40_5210b1=-1 or yast40_5210c3_000002=-1 or yast40_5210c3_000001=-1 or yast40_5210c4=-1 then othdebt2=-1; if yast40_5210b1=-2 or yast40_5210c3_000002=-2 or yast40_5210c3_000001=-2 or yast40_5210c4=-2 then othdebt2=-1; if yast40_5210b1=-3 or yast40_5210c3_000002=-3 or yast40_5210c3_000001=-3 or yast40_5210c4=-3 or yast40_5210c2=-3 then othdebt2=-3; if yast40_5210d1=1 then do; flag_othdebt3=1; if yast40_5210d1a=1 & yast40_5210d2>=0 then othdebt3=yast40_5210d2; else if yast40_5210d1a=2 & yast40_5210d3_000001>=0 & yast40_5210d3_000002>=0 then do; if yast40_5210d3_000002>=yast40_5210d3_000001 then othdebt3 = (yast40_5210d3_000001+yast40_5210d3_000002)/2; else othdebt3=-3; end; if yast40_5210d1a not in (1,2) or yast40_5210d2 in (-1,-2) then do; if 1<=yast40_5210d4<=7 then flag_othdebt3=2; if yast40_5210d4=1 then othdebt3=500; else if yast40_5210d4=2 then othdebt3=1750; else if yast40_5210d4=3 then othdebt3=3750; else if yast40_5210d4=4 then othdebt3=7500; else if yast40_5210d4=5 then othdebt3=17500; else if yast40_5210d4=6 then othdebt3=37500; else if yast40_5210d4=7 then othdebt3=50001; end; end; if yast40_5210d1=-1 or yast40_5210d3_000001=-1 or yast40_5210d3_000002=-1 or yast40_5210d4=-1 then othdebt3=-1; if yast40_5210d1=-2 or yast40_5210d3_000001=-2 or yast40_5210d3_000002=-2 or yast40_5210d4=-2 then othdebt3=-2; if yast40_5210d1=-3 or yast40_5210d3_000001=-3 or yast40_5210d3_000002=-3 or yast40_5210d4=-3 or yast40_5210d2=-3 then othdebt3=-3; /************************************************************************************ end of data cleaning for liabilities and assets begin calculations: **********************************************************************************/ array varsasst (*) house_value pvbuss_01-pvbuss_04 othreal ira_01-ira_07 retdsav banksav bonds stocks pvcars1 pvcars2 pvfurn othsav loans; array varsliab (*) mortgag resdebt othmort cardebt1 cardebt2 comboedudebt2 othdebt1 othdebt2 othdebt3 famdebt; array flgsasst (*) flag_house flag_pvbuss flag_othreal flag_ira flag_retdsav flag_banksav flag_bonds flag_stocks flag_pvcars1 flag_pvcars2 flag_pvfurn flag_othsav flag_loans; array flgsliab (*) flag_mortgag flag_resdebt flag_othmort flag_cardebt1 flag_cardebt2 flag_comboedudebt2 flag_othdebt1 flag_othdebt2 flag_othdebt3 flag_famdebt; array ahousedebt (*) mortgag resdebt othmort; array afinance (*) ira_01-ira_07 retdsav banksav bonds stocks othsav loans; array anonfinance (*) pvbuss_01-pvbuss_04 othreal pvcars1 pvcars2 pvfurn; array adebt (*) cardebt1 cardebt2 comboedudebt2 othdebt1 othdebt2 othdebt3 famdebt; array flgshsdt(*) flag_mortgag flag_resdebt flag_othmort; array flgsfin(*) flag_ira flag_retdsav flag_banksav flag_bonds flag_stocks flag_othsav flag_loans; array flgsnonfin(*) flag_pvbuss flag_othreal flag_pvcars1 flag_pvcars2 flag_pvfurn; array flgsdebt(*) flag_cardebt1 flag_cardebt2 flag_comboedudebt2 flag_othdebt1 flag_othdebt2 flag_othdebt3 flag_famdebt; hhworthy=-4; assets=-4; liabilities=-4; housedebt=-4; finance=-4; nonfinance=-4; debt=-4; if yast40_age40elig1=1 then do; hhworthy=0; assets=0; housedebt=0; liabilities=0; finance=0; nonfinance=0; debt=0; do i=1 to dim(varsasst); if varsasst(i) not in (-1,-2,-3,-4,-5) then assets=assets+varsasst(i); if varsasst(i) in (-1,-2,-3) then flagsasst=-3; end; do i=1 to dim(varsliab); if varsliab(i) not in (-1,-2,-3,-4,-5) then liabilities=liabilities+varsliab(i); if varsliab(i) in (-1,-2,-3) then flagsliab=-3; end; hhworthy=assets-liabilities; do i=1 to dim(ahousedebt); if ahousedebt(i) not in (-1,-2,-3,-4,-5) then housedebt=housedebt+ahousedebt(i); if ahousedebt(i) in (-1,-2,-3) then flagshsdt=-3; end; do i=1 to dim(afinance); if afinance(i) not in (-1,-2,-3,-4,-5) then finance=finance+afinance(i); if afinance(i) in (-1,-2,-3) then flagsfin=-3; end; do i=1 to dim(anonfinance); if anonfinance(i) not in (-1,-2,-3,-4,-5) then nonfinance=nonfinance+anonfinance(i); if anonfinance(i) in (-1,-2,-3) then flagsnonfin=-3; end; do i=1 to dim(adebt); if adebt(i) not in (-1,-2,-3,-4,-5) then debt=debt+adebt(i); if adebt(i) in (-1,-2,-3) then flagsdebt=-3; end; end; /*** code hhworthy as an invalid skip for those who did not give valid responses */ do i=1 to dim(varsasst); if varsasst(i)=-1 then do; hhworthy=-1; assets=-1; invskphhy=1; end; end; do i=1 to dim(varsliab); if varsliab(i)=-1 then do; hhworthy=-1; liabilities=-1; invskphhy=1; end; end; do i=1 to dim(varsasst); if varsasst(i)=-2 then do; hhworthy=-2; assets=-2; invskphhy=2; end; end; do i=1 to dim(varsliab); if varsliab(i)=-2 then do; hhworthy=-2; liabilities=-2; invskphhy=2; end; end; do i=1 to dim(varsasst); if varsasst(i)=-3 then do; hhworthy=-3; assets=-3; invskphhy=3; end; end; do i=1 to dim(varsliab); if varsliab(i)=-3 then do; hhworthy=-3; liabilities=-3; invskphhy=3; end; end; do i=1 to dim(ahousedebt); if ahousedebt(i)=-1 then housedebt=-1; else if ahousedebt(i)=-2 then housedebt=-2; else if ahousedebt(i)=-3 then housedebt=-3; end; do i=1 to dim(afinance); if afinance(i)=-1 then finance=-1; else if afinance(i)=-2 then finance=-2; else if afinance(i)=-3 then finance=-3; end; do i=1 to dim(anonfinance); if anonfinance(i)=-1 then nonfinance=-1; else if anonfinance(i)=-2 then nonfinance=-2; else if anonfinance(i)=-3 then nonfinance=-3; end; do i=1 to dim(adebt); if adebt(i)=-1 then debt=-1; else if adebt(i)=-2 then debt=-2; else if adebt(i)=-3 then debt=-3; end; hhworthy=round(hhworthy,1); assets=round(assets,1); liabilities=round(liabilities,1); housedebt=round(housedebt,1); house_value=round(house_value,1); finance=round(finance,1); nonfinance=round(nonfinance,1); debt=round(debt,1); /** change all the -1s, -2s to -3s. **/ array finalv(*) hhworthy assets liabilities housedebt house_value finance nonfinance debt; do i=1 to dim(finalv); if finalv(i) in (-1,-2) then finalv(i)=-3; end; data three; merge one asset20.astr19_cvc; by pubid; cvc_assets_rnd_40 = -4; cvc_hh_net_worth_40 = -4; cvc_house_value_40 = -4; cvc_house_debt_40 = -4; cvc_house_type_40 = -4; cvc_assets_financial_40 = -4; cvc_assets_nonfinancial_40 = -4; cvc_assets_debts_40 = -4; cvpreval = -4; array cvprevrd(7) cvc_hh_net_worth_40 cvc_house_value_40 cvc_house_debt_40 cvc_house_type_40 cvc_assets_financial_40 cvc_assets_nonfinancial_40 cvc_assets_debts_40; do i=1 to dim(cvprevrd); if cvprevrd(i) ~=-4 then cvpreval=1; end; array curr(7) hhworthy house_value housedebt housing_type finance nonfinance debt ; do i=1 to dim(curr); if curr(i) not in (-4,-5,.) then currval=1; end; assetrd_cvc=-4 ; array cvc(7) hhworthy_cvc house_value_cvc housedebt_cvc housing_type_cvc finance_cvc nonfinance_cvc debt_cvc ; do i = 1 to dim(cvc); cvc(i)=-4; end; * curr vs cvc from the prev round; if cvpreval =1 & cvc_assets_rnd_40 not in (20) then flag1=1; if cvpreval =1 & currval=1 then flag2=1; if currval=1 & cvc_assets_rnd_40 in (20) then flag3=1; if cvpreval =1 & cvc_assets_rnd_40 in (20) & currval~=1 then do i = 1 to 7 ; assetrd_cvc= cvc_assets_rnd_40; cvc(i)=cvprevrd(i); end; if cvpreval ~=1 & cvc_assets_rnd_40 not in (20) & currval=1 then do i = 1 to 7 ; assetrd_cvc=20; *Program note 1 exception: only thing to change in r21 codes is round from 20 to 21; cvc(i)=curr(i); end; /* top coding, and bottom coding */ if hhworthy_cvc ge 600000 then hhworthy_cvc=600000; if house_value_cvc ge 425000 then house_value_cvc=425000; if housedebt_cvc ge 325000 then housedebt_cvc=325000; if finance_cvc ge 300000 then finance_cvc=300000; if nonfinance_cvc ge 600000 then nonfinance_cvc=600000; if debt_cvc ge 370000 then debt_cvc=370000; if hhworthy_cvc le -300000 then hhworthy_cvc=-300000; if nonfinance_cvc le -300000 then nonfinance_cvc=-300000; rename hhworthy_cvc = 'cvc_hh_net_worth_40'n house_value_cvc = 'cvc_house_value_40'n housedebt_cvc = 'cvc_house_debt_40'n housing_type_cvc = 'cvc_house_type_40'n finance_cvc = 'cvc_assets_financial_40'n nonfinance_cvc = 'cvc_assets_nonfinancial_40'n debt_cvc = 'cvc_assets_debts_40'n assetrd_cvc = 'cvc_assets_rnd_40'n;