Appendix 5: Income and Assets Variable Creation

Return to Table of Contents


Household Income and Assets

Variables Created:

Variables Used

      These variables are listed in a separate file (due to the length of the list).

This program creates the household net worth and gross household income variables. The household net worth variable coded as hhworthY is an actual number that results from adding the values of all assets and subtracting liabilities of the household. The gross household income variable coded as groshhIY includes total annual cash receipts before taxes from all sources. The program then creates a ratio comparing the household's total income to federal poverty guidelines based on the number of household residents and the number of members under age 18.

Researchers should note that, like many income and asset variables in the data set, these three variables are topcoded to protect respondent privacy.  More information about topcoding is available in the NLSY97 User's Guide.


/******************* SECTION 1:  GROSS HOUSEHOLD INCOME *********************/

*** First create the following components of the groshhIY such as income from wages and salaries, etc.;
*** Each subsection computes one item of the total income of Youth Respondent's family. Flag variables
are created to indicate whether Respondent (and the family) received that income item (FLAG_item~=0)
and if so was the amount computed directly from the amount reported by Respondent (FLAG_item=1) or
it was computed from estimates given by Respondent (FLAG_item=2) or it could not be computed at all
(FLAG_item=-3);

*** Income from non-farm employment of respondent - (nfarmY);

nfarmY=-4;

if YI_1400=1 or (YI_1400 in (-1,-2,-3) & YI_1600=1) then do;

   flag_nfarmY=1;

   if YI_1700>=0 then nfarmY=YI_1700;

   if YI_1700 in (-1,-2,-3) then do;

      if 1<=YI_1800<=7 then flag_nfarmY=2;

      if YI_1800=1 then nfarmY=2500;

      if YI_1800=2 then nfarmY=7500;

      if YI_1800=3 then nfarmY=17500;

      if YI_1800=4 then nfarmY=37500;

      if YI_1800=5 then nfarmY=75000;

      if YI_1800=6 then nfarmY=175000;

      if YI_1800=7 then nfarmY=250001;

   end;

end;

if YI_1600=-1 or YI_1800=-1 then nfarmY=-1;

if YI_1600=-2 or YI_1800=-2 then nfarmY=-2;

if YI_1600=-3 or YI_1800=-3 then nfarmY=-3;

 

 

*** Income from farm and self-employment of respondent - (farmY);

farmY=-4;

if YI_2000=1 then do;

   flag_farmY=1;

   if YI_2100>=0 then farmY=YI_2100;

   if YI_2100 in (-1,-2,-3) then do;

      if 2<=YI_2200<=8 then flag_farmY=2;

      if YI_2200=1 then farmY=-2;

      if YI_2200=2 then farmY=2500;

      if YI_2200=3 then farmY=7500;

      if YI_2200=4 then farmY=17500;

      if YI_2200=5 then farmY=37500;

      if YI_2200=6 then farmY=75000;

      if YI_2200=7 then farmY=175000;

      if YI_2200=8 then farmY=250001;

   end;

end;

if YI_2000=-1 or YI_2200=-1 then farmY=-1;

if YI_2000=-2 or YI_2200=-2 then farmY=-2;

if YI_2000=-3 or YI_2200=-3 then farmY=-3;

 

 

*** If the respondent received worker's comp - wcompY;

wcompY=-4;

if YI_2250=1 then do;

   flag_wcompY=1;

   if YI_2260>=0 then wcompY=YI_2260;

   if YI_2260 in (-1,-2,-3) then do;

      if 2<=YI_2270<=8 then flag_wcompY=2;

      if YI_2270=1 then wcompY=0;

      if YI_2270=2 then wcompY=2500;

      if YI_2270=3 then wcompY=7500;

      if YI_2270=4 then wcompY=17500;

      if YI_2270=5 then wcompY=37500;

      if YI_2270=6 then wcompY=75000;

      if YI_2270=7 then wcompY=175000;

      if YI_2270=8 then wcompY=250001;

   end;

end;

if YI_2250=-1 or YI_2270=-1 then wcompY=-1;

if YI_2250=-2 or YI_2270=-2 then wcompY=-2;

if YI_2250=-3 or YI_2270=-3 then wcompY=-3;

 

 

*** Income from non-farm employment of respondent's spouse/partner - nfarmP;

nfarmP=-4;

if YI_2300=1 & (YI_2400=1 or (YI_2400=-1 & YI_2500=1)) then do;

   flag_nfarmP=1;

   if YI_2600>=0 then nfarmP=YI_2600;

   if YI_2600 in (-1,-2,-3) then do;

      if 1<=YI_2700<=7 then flag_nfarmP=2;

      if YI_2700=1 then nfarmP=2500;

      if YI_2700=2 then nfarmP=7500;

      if YI_2700=3 then nfarmP=17500;

      if YI_2700=4 then nfarmP=37500;

      if YI_2700=5 then nfarmP=75000;

      if YI_2700=6 then nfarmP=175000;

      if YI_2700=7 then nfarmP=250001;

   end;

end;

if YI_2300=-1               or YI_2500=-1 or YI_2700=-1 then nfarmP=-1;

if YI_2300=-2 or YI_2400=-2 or YI_2500=-2 or YI_2700=-2 then nfarmP=-2;

if YI_2300=-3 or YI_2400=-3 or YI_2500=-3 or YI_2700=-3 then nfarmP=-3;

 

 

*** Income from farm and self-employment of respondent's spouse/partner - farmP;

farmP=-4;

if YI_2300=1 & YI_2900=1 then do;

   flag_farmP=1;

   if YI_3000>=0 then farmP=YI_3000;

   if YI_3000 in (-1,-2,-3) then do;

      if 2<=YI_3100<=8 then flag_farmP=2;

      if YI_3100=1 then farmP=-2;

      if YI_3100=2 then farmP=2500;

      if YI_3100=3 then farmP=7500;

      if YI_3100=4 then farmP=17500;

      if YI_3100=5 then farmP=37500;

      if YI_3100=6 then farmP=75000;

      if YI_3100=7 then farmP=175000;

      if YI_3100=8 then farmP=250001;

   end;

end;

if YI_2300=-1 or YI_2900=-1 or YI_3100=-1 then farmP=-1;

if YI_2300=-2 or YI_2900=-2 or YI_3100=-2 then farmP=-2;

if YI_2300=-3 or YI_2900=-3 or YI_3100=-3 then farmP=-3;

 

 

*** If the respondent's partner/spouse received worker's comp - wcompP;

wcompP=-4;

if YI_2300=1 & YI_3150=1 then do;

   flag_wcompP=1;

   if YI_3160>=0 then wcompP=YI_3160;

   if YI_3160 in (-1,-2,-3) then do;

      if 1<=YI_3170<=7 then flag_wcompP=2;

      if YI_3170=1 then wcompP=500;

      if YI_3170=2 then wcompP=1250;

      if YI_3170=3 then wcompP=3750;

      if YI_3170=4 then wcompP=7500;

      if YI_3170=5 then wcompP=17500;

      if YI_3170=6 then wcompP=37500;

      if YI_3170=7 then wcompP=50001;

   end;

end;

if YI_2300=-1 or YI_3150=-1 or YI_3170=-1 then wcompP=-1;

if YI_2300=-1 or YI_3150=-2 or YI_3170=-2 then wcompP=-2;

if YI_2300=-1 or YI_3150=-3 or YI_3170=-3 then wcompP=-3;

 

 

*** Child support payment received by respondent or his/her partner/spouse - chsup;

chsup=-4;

if YI_3300=1 & YI_3900=1 then do;

   flag_chsup=1;

   if YI_4000=1 & YI_4100>=0 then chsup=YI_4100;

   if YI_4000=1 & YI_4100 in (-1,-2,-3) then do;

      if 1<=YI_4200<=7 then flag_chsup=2;

      if YI_4200=1 then chsup=500;

      if YI_4200=2 then chsup=1750;

      if YI_4200=3 then chsup=3750;

      if YI_4200=4 then chsup=7500;

      if YI_4200=5 then chsup=17500;

      if YI_4200=6 then chsup=37500;

      if YI_4200=7 then chsup=50001;

   end;

end;

if YI_3300=-1 or YI_3900=-1 or YI_4000=-1 or YI_4200=-1 then chsup=-1;

if YI_3300=-2 or YI_3900=-2 or YI_4000=-2 or YI_4200=-2 then chsup=-2;

if YI_3300=-1 or YI_3900=-1 or YI_4000=-3 or YI_4200=-3 then chsup=-3;

 

 

*** Interest payments received by the respondent and his/her partner/spouse - intrst;

intrst=-4;

if YI_4300=1 then do;

   flag_intrst=1;

   if YI_4400>=0 then intrst=YI_4400;

   if YI_4400 in (-1,-2,-3) then do;

      if 1<=YI_4500<=7 then flag_intrst=2;

      if YI_4500=1 then intrst=250;

      if YI_4500=2 then intrst=750;

      if YI_4500=3 then intrst=1750;

      if YI_4500=4 then intrst=3750;

      if YI_4500=5 then intrst=6250;

      if YI_4500=6 then intrst=8750;

      if YI_4500=7 then intrst=10001;

   end;

end;

if YI_4300=-1 or YI_4500=-1 then intrst=-1;

if YI_4300=-2 or YI_4500=-2 then intrst=-2;

if YI_4300=-3 or YI_4500=-3 then intrst=-3;

 

 

*** Dividends from stocks & mutual funds received by the respondent and his/her partner/spouse - dvdend;

dvdend=-4;

if YI_4600=1 then do;

   flag_dvdend=1;

   if YI_4700>=0 then dvdend=YI_4700;

   if YI_4700 in (-1,-2,-3) then do;

      if 1<=YI_4800<=7 then flag_dvdend=2;

      if YI_4800=1 then dvdend=250;

      if YI_4800=2 then dvdend=750;

      if YI_4800=3 then dvdend=1750;

      if YI_4800=4 then dvdend=3750;

      if YI_4800=5 then dvdend=6250;

      if YI_4800=6 then dvdend=8750;

      if YI_4800=7 then dvdend=10001;

   end;

end;

if YI_4600=-1 or YI_4800=-1 then dvdend=-1;

if YI_4600=-2 or YI_4800=-2 then dvdend=-2;

if YI_4600=-3 or YI_4800=-3 then dvdend=-3;

 

 

*** Rental income received by the respondent and his/her partner/spouse - rntinc;

rntinc=-4;

if YI_4900=1 then do;

   if YI_5000>=0 then rntinc=YI_5000;

   if YI_5000 in (-1,-2,-3) then do;

      if 1<=YI_5100<=7 then flag_rntinc=2;

      if YI_5100=1 then rntinc=500;

      if YI_5100=2 then rntinc=1750;

      if YI_5100=3 then rntinc=3750;

      if YI_5100=4 then rntinc=7500;

      if YI_5100=5 then rntinc=17500;

      if YI_5100=6 then rntinc=37500;

      if YI_5100=7 then rntinc=50001;

   end;

end;

if YI_4900=-1 or YI_5100=-1 then rntinc=-1;

if YI_4900=-2 or YI_5100=-2 then rntinc=-2;

if YI_4900=-3 or YI_5100=-3 then rntinc=-3;

 

 

*** Property or money from estates, trusts, annuities or inheritances received by the respondent and

    his/her partner/spouse - astinc;

astinc=-4;

if YI_5200=1 then do;

   flag_astinc=1;

   if YI_5300>=0 then astinc=YI_5300;

   if YI_5300 in (-1,-2,-3) then do;

      if 1<=YI_5400<=7 then flag_astinc=2;

      if YI_5400=1 then astinc=2500;

      if YI_5400=2 then astinc=7500;

      if YI_5400=3 then astinc=17500;

      if YI_5400=4 then astinc=37500;

      if YI_5400=5 then astinc=75000;

      if YI_5400=6 then astinc=175000;

      if YI_5400=7 then astinc=250001;

   end;

end;

if YI_5200=-1 or YI_5400=-1 then astinc=-1;

if YI_5200=-2 or YI_5400=-2 then astinc=-2;

if YI_5200=-3 or YI_5400=-3 then astinc=-3;

 

 

*** Income from other sources: ss payments, pension and retirement income, alimony, payments from

    insurance policies, etc. received by the respondent and his/her partner/spouse - othinc;

othinc=-4;

if YI_7600=1 then do;

   flag_othinc=1;

   if YI_7700>=0 then othinc=YI_7700;

   if YI_7700 in (-1,-2,-3) then do;

      if 1<=YI_7800<=7 then flag_othinc=2;

      if YI_7800=1 then othinc=500;

      if YI_7800=2 then othinc=1750;

      if YI_7800=3 then othinc=3750;

      if YI_7800=4 then othinc=7500;

      if YI_7800=5 then othinc=17500;

      if YI_7800=6 then othinc=37500;

      if YI_7800=7 then othinc=50001;

   end;

end;

if YI_7600=-1 or YI_7800=-1 then othinc=-1;

if YI_7600=-2 or YI_7800=-2 then othinc=-2;

if YI_7600=-3 or YI_7800=-3 then othinc=-3;

 

 

array NHIRELY (*) NHIRELY01-NHIRELY27;

array HIRELY (*) HIRELY01-HIRELY13;

 

do i=1 to dim(HIRELY);

   if HIRELY(i)=3 then lv_mom=1;

   if HIRELY(i)=4 then lv_dad=1;

   if HIRELY(i) in (6,8,10) then lv_odad=1;

   if HIRELY(i) in (5,7,9) then lv_omom=1;

end;

do i=1 to dim(NHIRELY);

   if NHIRELY(i) in (6,8,10) then nlv_odad=1;

   if NHIRELY(i) in (5,7,9) then nlv_omom=1;

end;

 

 

*** Income from Mother. Note: Identify whether the respondent's mother lived in the household;

mominc=-4; momgft=-4;

 

** If the respondent lived with his/her mother, then mother's income - mominc.;

if lv_mom=1 then do;

   if YI_9200=1 then do;

      flag_mominc=1;

      if YI_9300>=0 then mominc=YI_9300;

      if YI_9300 in (-1,-2,-3) then do;

         if 1<=YI_9400<=7 then flag_mominc=2;

         if YI_9400=1 then mominc=2500;

         if YI_9400=2 then mominc=7500;

         if YI_9400=3 then mominc=17500;

         if YI_9400=4 then mominc=37500;

         if YI_9400=5 then mominc=75000;

         if YI_9400=6 then mominc=175000;

         if YI_9400=7 then mominc=250001;

      end;

   end;

   if YI_9200=-1 or YI_9400=-1 then mominc=-1;

   if YI_9200=-2 or YI_9400=-2 then mominc=-2;

   if YI_9200=-3 or YI_9400=-3 then mominc=-3;

end;

 

** If the respondent DID NOT live with his/her mother but received monetary gifts from the mother

    which is not an allowance, then mother's monetary gift - momgft.;

if lv_mom~=1 then do;

   if YI_6500=1 then do;

      flag_momgft=1;

      if YI_6600>=0 then momgft=YI_6600;

      if YI_6500=1 & YI_6600 in (-1,-2,-3) then do;

         if 1<=YI_6700<=7 then flag_momgft=2;

         if YI_6700=1 then momgft=250;

         if YI_6700=2 then momgft=750;

         if YI_6700=3 then momgft=1750;

         if YI_6700=4 then momgft=3750;

         if YI_6700=5 then momgft=6250;

         if YI_6700=6 then momgft=8750;

         if YI_6700=7 then momgft=10001;

      end;

   end;

   if YI_6500=-1 or YI_6700=-1 then momgft=-1;

   if YI_6500=-2 or YI_6700=-2 then momgft=-2;

   if YI_6500=-3 or YI_6700=-3 then momgft=-3;

end;

 

 

*** Income from Father. Note: Identify whether the respondent's father lives in the household;

dadinc=-4; dadgft=-4;

 

** If the respondent lived with his/her father, then father's income - dadinc.;

if lv_dad=1 then do;

   if YI_8700=1 then do;

      flag_dadinc=1;

      if YI_8800>=0 then dadinc=YI_8800;

      if YI_8700=1 & YI_8800 in (-1,-2,-3) then do;

         if 1<=YI_8900<=7 then flag_dadinc=2;

         if YI_8900=1 then dadinc=2500;

         if YI_8900=2 then dadinc=7500;

         if YI_8900=3 then dadinc=17500;

         if YI_8900=4 then dadinc=37500;

         if YI_8900=5 then dadinc=75000;

         if YI_8900=6 then dadinc=175000;

         if YI_8900=7 then dadinc=250001;

      end;

   end;

   if YI_8700=-1 or YI_8900=-1 then dadinc=-1;

   if YI_8700=-2 or YI_8900=-2 then dadinc=-2;

   if YI_8700=-3 or YI_8900=-3 then dadinc=-3;

end;

 

** If the respondent DID NOT live with his/her father but received monetary gifts from the father

    which is not an allowance, then father's monetary gift - dadgft.;

if lv_dad~=1 then do;

   if YI_7100=1 then do;

      flag_dadgft=1;

      if YI_7200>=0 then dadgft=YI_7200;

      if YI_7100=1 & YI_7200 in (-1,-2,-3) then do;

         if 1<=YI_7300<=7 then flag_dadgft=2;

         if YI_7300=1 then dadgft=250;

         if YI_7300=2 then dadgft=750;

         if YI_7300=3 then dadgft=1750;

         if YI_7300=4 then dadgft=3750;

         if YI_7300=5 then dadgft=6250;

         if YI_7300=6 then dadgft=8750;

         if YI_7300=7 then dadgft=10001;

      end;

   end;

   if YI_7100=-1 or YI_7300=-1 then dadgft=-1;

   if YI_7100=-2 or YI_7300=-2 then dadgft=-2;

   if YI_7100=-3 or YI_7300=-3 then dadgft=-3;

end;

 

** If there is at least one non-resident non-biological parent and the "gift from parents" is not equal

   to the sum of the "gift from mom" and "gift from dad" then we cannot say for sure which part of the

   "gift from parents" is from a non-resident parent. However, if the "gift from parents" is equal to

   "gifts from mom (dad)" then we could assume that the parents' gift is basically the gift from mom

   (dad) and so it is OK. Otherwise make dadgft and momgft equal to -3.;

 

if YI_5700=1 & YI_7100=1 & YI_6500=1 & YI_5800>=0 & YI_7200>0 & YI_6600>0

                  then dfpar=YI_6600+YI_7200-YI_5800;

if YI_5700=1 & YI_7100=1 & YI_6500=1 & -4<YI_5800<0  & -4<YI_7200<0  & -4<YI_6600<0  then dfpar1=1;

if YI_5700=1 & YI_7100=1 & YI_6500=1 & -4<YI_5800<0  &    YI_7200>=0 & -4<YI_6600<0  then dfpar1=2;

if YI_5700=1 & YI_7100=1 & YI_6500=1 & -4<YI_5800<0  & -4<YI_7200<0  &    YI_6600>=0 then dfpar1=3;

if YI_5700=1 & YI_7100=1 & YI_6500=1 & -4<YI_5800<0  &    YI_7200>=0 &    YI_6600>=0 then dfpar1=4;

if YI_5700=1 & YI_7100=1 & YI_6500=1 &    YI_5800>=0 & -4<YI_7200<0  & -4<YI_6600<0  then dfpar1=5;

if YI_5700=1 & YI_7100=1 & YI_6500=1 &    YI_5800>=0 &    YI_7200>=0 & -4<YI_6600<0  then dfpar1=6;

if YI_5700=1 & YI_7100=1 & YI_6500=1 &    YI_5800>=0 & -4<YI_7200<0  &    YI_6600>=0 then dfpar1=7;

 

if YI_5700=1 & YI_6500=1 & YI_7100=0 & YI_5800>=0 & YI_6600>=0     then dfmom=YI_6600-YI_5800;

if YI_5700=1 & YI_6500=1 & YI_7100=0 & -4<YI_5800<0 & -4<YI_6600<0 then dfmom1=1;

if YI_5700=1 & YI_6500=1 & YI_7100=0 & -4<YI_5800<0 & YI_6600>=0   then dfmom1=2;

if YI_5700=1 & YI_6500=1 & YI_7100=0 & -4<YI_6600<0 & YI_5800>=0   then dfmom1=3;

 

if YI_5700=1 & YI_7100=1 & YI_6500=0 & YI_5800>=0 & YI_7200>=0     then dfdad=YI_7200-YI_5800;

if YI_5700=1 & YI_7100=1 & YI_6500=0 & -4<YI_5800<0 & -4<YI_7200<0 then dfdad1=1;

if YI_5700=1 & YI_7100=1 & YI_6500=0 & -4<YI_5800<0 & YI_7200>=0   then dfdad1=2;

if YI_5700=1 & YI_7100=1 & YI_6500=0 & -4<YI_7200<0 & YI_5800>=0   then dfdad1=3;

 

if PUBID in

(3424 3433 3464 3518 3520 3524 3525 3527 3528 3530 3533 3535 3536 3537 3538 3539 3543 3553 3557 3565 3799 3833 4207 4292 4434 4686 5124 5125 5573 6066 7325 7552 7822 8412) then do;

   comments=1;

end;

 

if (nlv_odad=1 or nlv_omom=1) & comments~=1 then do;

   if dfpar~=0 & dfpar~=. & YI_5800~=YI_6600 & YI_5800~=YI_7200 then do;

      momgft=-3;

      dadgft=-3;

      FLAG_momgft=-6;

      FLAG_dadgft=-6;

   end;

   if dfmom~=0 & dfmom~=. & YI_5800~=YI_6600 then do;

      momgft=-3;

      dadgft=-3;

      FLAG_momgft=-7;

      FLAG_dadgft=-7;

   end;

   if dfdad~=0 & dfdad~=. & YI_5800~=YI_7200 then do;

      momgft=-3;

      dadgft=-3;

      FLAG_dadgft=-8;

      FLAG_momgft=-8;

   end;

   if (dfpar1=1 & YI_5900~=YI_6700 & YI_5900~=YI_7300 & YI_5900>0)

   or (dfmom1=1 & YI_5900~=YI_6700 & YI_5900>0)

   or (dfdad1=1 & YI_5900~=YI_7300 & YI_5900>0)

   or (dfpar1>1|dfmom1>1|dfdad1>1) then do;

      momgft=-3;

      dadgft=-3;

      FLAG_momgft=-9;

      FLAG_dadgft=-9;

   end;

end;

 

*** If the respondent lived with a female guardian, then female guardian's income - fmginc;

fmginc=-4;

if YI_10100=1 then do;

   if YI_10200=1 then do;

      flag_fmginc=1;

      if YI_10300>=0 then fmginc=YI_10300;

      if YI_10300 in (-1,-2,-3) then do;

         if 1<=YI_10400<=7 then flag_fmginc=2;

         if YI_10400=1 then fmginc=2500;

         if YI_10400=2 then fmginc=7500;

         if YI_10400=3 then fmginc=17500;

         if YI_10400=4 then fmginc=37500;

         if YI_10400=5 then fmginc=75000;

         if YI_10400=6 then fmginc=175000;

         if YI_10400=7 then fmginc=250001;

      end;

   end;

   if YI_10200=-1 or YI_10400=-1 then fmginc=-1;

   if YI_10200=-2 or YI_10400=-2 then fmginc=-2;

   if YI_10200=-3 or YI_10400=-3 then fmginc=-3;

end;

 

 

*** If the respondent lived with a male guardian, then male guardian's income - mlginc;

mlginc=-4;

if YI_9600=1 then do;

   if YI_9700=1 then do;

      flag_mlginc=1;

      if YI_9800>=0 then mlginc=YI_9800;

      if YI_9800 in (-1,-2,-3) then do;

         if 1<=YI_9900<=7 then flag_mlginc=2;

         if YI_9900=1 then mlginc=2500;

         if YI_9900=2 then mlginc=7500;

         if YI_9900=3 then mlginc=17500;

         if YI_9900=4 then mlginc=37500;

         if YI_9900=5 then mlginc=75000;

         if YI_9900=6 then mlginc=175000;

         if YI_9900=7 then mlginc=250001;

      end;

   end;

   if YI_9700=-1 or YI_9900=-1 then mlginc=-1;

   if YI_9700=-2 or YI_9900=-2 then mlginc=-2;

   if YI_9700=-3 or YI_9900=-3 then mlginc=-3;

end;

 

 

*** Income of household members 14years or older (other than respondent's spouse/partner);

 

array otfamI   (*) otfamI01-otfamI13;

array YI_11100 (*) YI_1110001-YI_1110013;

array YI_11600 (*) YI_1160001-YI_1160013;

array YI_11700 (*) YI_1170001-YI_1170013;

 

do i=1 to dim(otfamI);

   otfamI(i)=-4;

   if YI_10800=1 & YI_11100(i)=0 then do;

      if YI_11600(i)>-4 & flag_otfamI~=2 then flag_othfamI=1;

      if YI_11600(i)>=0 then otfamI(i)=YI_11600(i);

      if YI_11600(i) in (-1,-2,-3) then do;

         if 1<=YI_11700(i)<=7 then flag_otfamI=2;

         if YI_11700(i)=1 then otfamI(i)=2500;

         if YI_11700(i)=2 then otfamI(i)=7500;

         if YI_11700(i)=3 then otfamI(i)=17500;

         if YI_11700(i)=4 then otfamI(i)=37500;

         if YI_11700(i)=5 then otfamI(i)=75000;

         if YI_11700(i)=6 then otfamI(i)=175000;

         if YI_11700(i)=7 then otfamI(i)=250001;

      end;

   end;

   if YI_11100(i)=-1 or YI_11700(i)=-1 then otfamI(i)=-1;

   if YI_11100(i)=-2 or YI_11700(i)=-2 then otfamI(i)=-2;

   if YI_11100(i)=-3 or YI_11700(i)=-3 then otfamI(i)=-3;

end;

 

** Income from welfare programs - AFDC, OTHER ASSISTANCE and UNEMPLOYMENT COMPENSATION of Respondent and

   spouse/partner.;

if incprg>0 then flag_prgamt=1;

 

** Wrong input information.;

if PUBID=406 then do;

   nfarmY=6500;

   intrst=50;

   dadinc=60000;

   otfamI01=2500;

   otfamI02=2500;

   otfamI03=2500;

   otfamI04=2500;

   otfamI05=2500;

   otfamI06=0;

   otfamI07=0;

   prgamt=0;

   incprg=0;

   handedit=1;

end;

 

*** Compute the respondent's gross household income in the past year (groshhIY);

 

array varsY (*) nfarmY      farmY       wcompY      nfarmP      farmP       wcompP      chsup 

                intrst      dvdend      rntinc      astinc      othinc      mominc      momgft

                dadinc      dadgft      mlginc      fmginc      prgamt     

                otfamI01-otfamI13;

array flgsY (*) flag_nfarmY flag_farmY  flag_wcompY flag_nfarmP flag_farmP  flag_wcompP flag_chsup 

                flag_intrst flag_dvdend flag_rntinc flag_astinc flag_othinc flag_mominc flag_momgft

                flag_dadinc flag_dadgft flag_mlginc flag_fmginc flag_prgamt

                flag_otfamI flag_otfamI flag_otfamI

                flag_otfamI flag_otfamI flag_otfamI flag_otfamI flag_otfamI

                flag_otfamI flag_otfamI flag_otfamI flag_otfamI flag_otfamI;

groshhIY=0;

do i=1 to dim(varsY);

   if varsY(i)>=0 then groshhIY=groshhIY+varsY(i);

   if varsY(i) in (-1,-2,-3) then flgsY(i)=varsY(i);

end;

 

*** Code groshhIY as an invalid skip if there are invalid responses.;

do i=1 to dim(varsY);

   if varsY(i)=-1 then do;

      groshhIY=-1;

      invskpGIY=1;

   end;

end;

do i=1 to dim(varsY);

   if varsY(i)=-2 then do;

      groshhIY=-2;

      invskpGIY=2;

   end;

end;

do i=1 to dim(varsY);

   if varsY(i)=-3 then do;

      groshhIY=-3;

      invskpGIY=3;

   end;

end;

 

 

*** Code groshhIY as -5 for all those respondents who were not interviewed in Round 7;

if yas050=-5 then do;

   groshhIY=-5;

   nonintGIY=1;

end;

 


/***************** SECTION 2:  HOUSEHOLD NET WORTH ****************/

*** First create the following components of the hhworthY such as real estate, loans, cars etc.;

*** Each subsection computes one item of the net asset of Youth Respondent and his/her spouse or

    partner. Flag variables are created to indicate whether Respondent (or the family) owned that

    asset/liability item (FLAG_item~=0) and if so was the amount computed directly from the amount

    reported by Respondent (FLAG_item=1) or it was computed from estimates given by Respondent

    (FLAG_item=2) or it could not be computed (FLAG_item=-3);

array varsL (*) yas1864L yas2144L yas2174L yas2554L yas2764L

                yas3014L yas3384L yas3754L yas3814L yas3884L

                yas3924L yas4034L yas4164L yas4294L yas4424L

                yas4554L yas4684L yas4814L yas4844L yas4904L yas5224L

                yas5084L01-yas5084L20  yas5084L01-yas5084L20

                yas5174L01-yas5174L20  yas5174L01-yas5174L20;

                 

array varsU (*) yas1864U yas2144U yas2174U yas2554U yas2764U

                yas3014U yas3384U yas3754U yas3814U yas3884U

                yas3924U yas4034U yas4164U yas4294U yas4424U

                yas4554U yas4684U yas4814U yas4844U yas4904U yas5224U

                yas5084U01-yas5084U20  yas5084U01-yas5084U20

                yas5174U01-yas5174U20 yas5174U01-yas5174U20;

                                  

do i=1 to dim(varsL);

   if varsL(i)>=0 & varsU(i)>=0 & varsL(i)>varsU(i) then FLAG_range=1;

end;

 

 

************* ASSETS;

*** If the respondent owns some land, its present value - pvranch;

 

pvranch=-4;

** If the respondent alone or respondent and his/her partner/spouse jointly own all of it.;

if yas1400=1 & (yas1610=1 or yas1610=2) then do;

   FLAG_pvranch=1;

   if yas1860=1 & yas1862>=0 then pvranch=yas1862;

   if yas1860=2 & yas1864L>=0 & yas1864U>=0 then pvranch=yas1864L+(yas1864U-yas1864L)/2;

   if yas1860 not in (1,2) or yas1862 in (-1,-2) then do;

      if 1<=yas1866<=7 then FLAG_pvranch=2;

      if yas1866=1 then pvranch=12500;

      if yas1866=2 then pvranch=37500;

      if yas1866=3 then pvranch=75000;

      if yas1866=4 then pvranch=175000;

      if yas1866=5 then pvranch=375000;

      if yas1866=6 then pvranch=750000;

      if yas1866=7 then pvranch=1000001;

   end;

end;

** If the respondent alone or respondent and his/her partner/spouse jointly own part of it (100%).;

if yas1400=1 & (yas1610=3|yas1610=4) & yas2120=100 then do;

   FLAG_pvranch=1;

   if yas2140=1 & yas2142>=0 then pvranch=yas2142;

   if yas2140=2 & yas2144L>=0 & yas2144U>=0 then pvranch=(yas2144L+(yas2144U-yas2144L)/2);

   if yas2140 not in (1,2) or yas2142 in (-1,-2) then do;

      if 1<=yas2146<=7 then FLAG_pvranch=2;

      if yas2146=1 then pvranch=12500;

      if yas2146=2 then pvranch=37500;

      if yas2146=3 then pvranch=75000;

      if yas2146=4 then pvranch=175000;

      if yas2146=5 then pvranch=375000;

      if yas2146=6 then pvranch=750000;

      if yas2146=7 then pvranch=1000001;

   end;

end;

** If the respondent alone or respondent and his/her partner/spouse jointly own part of it (< 100%);

if yas1400=1 & (yas1610=3|yas1610=4) & yas2120~=100 then do;

   FLAG_pvranch=1;

   if yas2170=1 & yas2172>=0 then pvranch=yas2172;

   if yas2170=2 & yas2174L>=0 & yas2174U>=0 then pvranch=(yas2174L+(yas2174U-yas2174L)/2);

   if yas2170 not in (1,2) or yas2172 in (-1,-2) then do;

      if 1<=yas2176<=7 then FLAG_pvranch=2;

      if yas2176=1 then pvranch=12500;

      if yas2176=2 then pvranch=37500;

      if yas2176=3 then pvranch=75000;

      if yas2176=4 then pvranch=175000;

      if yas2176=5 then pvranch=375000;

      if yas2176=6 then pvranch=750000;

      if yas2176=7 then pvranch=1000001;

   end;

end;

if yas1400=-1 or yas1610=-1

or yas1864L=-1 or yas1864U=-1 or yas1866=-1

or yas2144L=-1 or yas2144U=-1 or yas2146=-1

or yas2174L=-1 or yas2174U=-1 or yas2176=-1 then pvranch=-1;

 

if yas1400=-2 or yas1610=-2

or yas1864L=-2 or yas1864U=-2 or yas1866=-2

or yas2144L=-2 or yas2144U=-2 or yas2146=-2

or yas2174L=-2 or yas2174U=-2 or yas2176=-2 then pvranch=-2;

 

if yas1400=-3 or yas1610=-3

or yas1864L=-3 or yas1864U=-3 or yas1866=-3

or yas2144L=-3 or yas2144U=-3 or yas2146=-3

or yas2174L=-3 or yas2174U=-3 or yas2176=-3

or yas1862=-3 or yas2142=-3 or yas2172=-3 then pvranch=-3;

 

  

*** If the respondent alone or respondent and his/her partner/spouse jointly own a mobile home and its

    site, its present value - pvmbst;

 

pvmbst=-4;

if yas2520 in (1,2) then do;

   FLAG_pvmbst=1;

   if yas2550=1 & yas2552>=0 then pvmbst=yas2552;

   if yas2550=2 & yas2554L>=0 & yas2554U>=0 then pvmbst=yas2554L+(yas2554U-yas2554L)/2;

   if yas2550 not in (1,2) or yas2552 in (-1,-2) then do;

      if 1<=yas2556<=7 then FLAG_pvmbst=2;

      if yas2556=1 then pvmbst=500;

      if yas2556=2 then pvmbst=1750;

      if yas2556=3 then pvmbst=3750;

      if yas2556=4 then pvmbst=7500;

      if yas2556=5 then pvmbst=17500;

      if yas2556=6 then pvmbst=37500;

      if yas2556=7 then pvmbst=50001;

   end;

end;

if yas2520=-1 or yas2554L=-1 or yas2554U=-1 or yas2556=-1               then pvmbst=-1;

if yas2520=-2 or yas2554L=-2 or yas2554U=-2 or yas2556=-2               then pvmbst=-2;

if yas2520=-3 or yas2554L=-3 or yas2554U=-3 or yas2556=-3 or yas2552=-3 then pvmbst=-3;

  

 

*** If the respondent alone or respondent and his/her partner/spouse jointly own a mobile home,

    its present value - pvmb;

 

pvmb=-4;

if yas2520 in (3,4) then do;

   FLAG_pvmb=1;

   if yas2760=1 then pvmb=yas2762;

   if yas2760=2 & yas2764L>=0 & yas2764U>=0 then pvmb=(yas2764L+(yas2764U-yas2764L)/2);

   if yas2760 not in (1,2) or yas2762 in (-1,-2) then do;

      if 1<=yas2766<=7 then FLAG_pvmb=2;

      if yas2766=1 then pvmb=12500;

      if yas2766=2 then pvmb=37500;

      if yas2766=3 then pvmb=75000;

      if yas2766=4 then pvmb=175000;

      if yas2766=5 then pvmb=375000;

      if yas2766=6 then pvmb=750000;

      if yas2766=7 then pvmb=1000001;

   end;

end;

if yas2520=-1 or yas2764L=-1 or yas2764U=-1 or yas2766=-1               then pvmb=-1;

if yas2520=-2 or yas2764L=-2 or yas2764U=-2 or yas2766=-2               then pvmb=-2;

if yas2520=-3 or yas2764L=-3 or yas2764U=-3 or yas2766=-3 or yas2762=-3 then pvmb=-3;

 

 

*** If the respondent alone or respondent and his/her partner/spouse jointly own a mobile home site,

    its present value - pvst;

 

pvst=-4;

if yas2520 in (5,6) then do;

   FLAG_pvst=1;

   if yas3010=1 & yas3012>=0 then pvst=yas3012;

   if yas3010=2 & yas3014L>=0 & yas3014U>=0 then pvst=(yas3014L+(yas3014U-yas3014L)/2);

   if yas3010 not in (1,2) or yas3012 in (-1,-2) then do;

      if 1<=yas3016<=7 then FLAG_pvst=2;

      if yas3016=1 then pvst=12500;

      if yas3016=2 then pvst=57500;

      if yas3016=3 then pvst=75000;

      if yas3016=4 then pvst=175000;

      if yas3016=5 then pvst=575000;

      if yas3016=6 then pvst=750000;

      if yas3016=7 then pvst=1000001;

   end;

end;

if yas2520=-1 or yas3014L=-1 or yas3014U=-1 or yas3016=-1               then pvst=-1;

if yas2520=-2 or yas3014L=-2 or yas3014U=-2 or yas3016=-2               then pvst=-2;

if yas2520=-3 or yas3014L=-3 or yas3014U=-3 or yas3016=-3 or yas3012=-3 then pvst=-3;

 

 

*** If the respondent alone or respondent and his/her partner/spouse jointly own an apartment,

    its present value - pvapt;

 

pvapt=-4;

if yas3310 in (1,2) then do;

   FLAG_pvapt=1;

   if yas3380=1 & yas3382>=0 then pvapt=yas3382;

   if yas3380=2 & yas3384L>=0 & yas3384U>=0 then pvapt=(yas3384L+(yas3384U-yas3384L)/2);

   if yas3380 not in (1,2) or yas3382 in (-1,-2) then do;

      if 1<=yas3386<=7 then FLAG_pvapt=2;

      if yas3386=1 then pvapt=500;

      if yas3386=2 then pvapt=1750;

      if yas3386=3 then pvapt=3750;

      if yas3386=4 then pvapt=7500;

      if yas3386=5 then pvapt=17500;

      if yas3386=6 then pvapt=37500;

      if yas3386=7 then pvapt=50001;

   end;

end;

if yas3310=-1 or yas3384L=-1 or yas3384U=-1 or yas3386=-1               then pvapt=-1;

if yas3310=-2 or yas3384L=-2 or yas3384U=-2 or yas3386=-2               then pvapt=-2;

if yas3310=-3 or yas3384L=-3 or yas3384U=-3 or yas3386=-3 or yas3382=-3 then pvapt=-3;

 

 

*** If the respondent alone or respondent and his/her partner/spouse jointly own a business, partnership

    or professional practice, its present value - pvbuss;

 

pvbuss=-4;

if yas4010 in (1,2) then do;

   FLAG_pvbuss=1;

   if yas4030=1 & yas4032>=0 then pvbuss=yas4032;

   if yas4030=2 then pvbuss=(yas4034L+(yas4034U-yas4034L)/2);

   if yas4030 not in (1,2) or yas4032 in (-1,-2) then do;

      if 1<=yas4036<=7 then FLAG_pvbuss=2;

      if yas4036=1 then pvbuss=12500;

      if yas4036=2 then pvbuss=37500;

      if yas4036=3 then pvbuss=75000;

      if yas4036=4 then pvbuss=175000;

      if yas4036=5 then pvbuss=375000;

      if yas4036=6 then pvbuss=750000;

      if yas4036=7 then pvbuss=1000001;

   end;

end;

if yas4010=-1 or yas4034L=-1 or yas4034U=-1 or yas4036=-1               then pvbuss=-1;

if yas4010=-2 or yas4034L=-2 or yas4034U=-2 or yas4036=-2               then pvbuss=-2;

if yas4010=-3 or yas4034L=-3 or yas4034U=-3 or yas4036=-3 or yas4032=-3 then pvbuss=-3;

 

 

*** If the respondent alone or respondent and his/her partner/spouse jointly own a second real estate,

    its present value - othreal;

 

othreal=-4;

if yas4140 in (1,2) then do;

   FLAG_othreal=1;

   if yas4160=1 & yas4162>=0 then othreal=yas4162;

   if yas4160=2 then othreal=(yas4164L+(yas4164U-yas4164L)/2);

   if yas4160 not in (1,2) or yas4162 in (-1,-2) then do;

      if 1<=yas4166<=7 then FLAG_othreal=2;

      if yas4166=1 then othreal=12500;

      if yas4166=2 then othreal=37500;

      if yas4166=3 then othreal=75000;

      if yas4166=4 then othreal=175000;

      if yas4166=5 then othreal=375000;

      if yas4166=6 then othreal=750000;

      if yas4166=7 then othreal=1000001;

   end;

end;

if yas4140=-1 or yas4164L=-1 or yas4164U=-1 or yas4166=-1               then othreal=-1;

if yas4140=-2 or yas4164L=-2 or yas4164U=-2 or yas4166=-2               then othreal=-2;

if yas4140=-3 or yas4164L=-3 or yas4164U=-3 or yas4166=-3 or yas4162=-3 then othreal=-3;

 

 

 *** If the respondent or his/her partner/spouse have retirement plans or pensions - retdsav;

 

retdsav=-4;

if yas4270 in (1,2,3) then do;

   FLAG_retdsav=1;

   if yas4290=1 & yas4292>=0 then retdsav=yas4292;

   if yas4290=2 & yas4294U>=0 & yas4294L>=0 then retdsav=(yas4294L+(yas4294U-yas4294L)/2);

   if yas4290 not in (1,2) or yas4292 in (-1,-2) then do;

      if 1<=yas4296<=7 then FLAG_retdsav=2;

      if yas4296=1 then retdsav=2500;

      if yas4296=2 then retdsav=7500;

      if yas4296=3 then retdsav=17500;

      if yas4296=4 then retdsav=37500;

      if yas4296=5 then retdsav=75000;

      if yas4296=6 then retdsav=175000;

      if yas4296=7 then retdsav=250001;

   end;

end;

if yas4270=-1 or yas4294L=-1 or yas4294U=-1 or yas4296=-1               then retdsav=-1;

if yas4270=-2 or yas4294L=-2 or yas4294U=-2 or yas4296=-2               then retdsav=-2;

if yas4270=-3 or yas4294L=-3 or yas4294U=-3 or yas4296=-3 or yas4292=-3 then retdsav=-3;

 

 

*** If the respondent or his/her partner/spouse have banksav in saving accounts, money market, funds,

    trusts, - banksav;

 

banksav=-4;

if yas4400 in (1,2,3) then do;

   FLAG_banksav=1;

   if yas4420=1 & yas4422>=0 then banksav=yas4422;

   if yas4420=2 & yas4424U>=0 & yas4424L>=0 then banksav=(yas4424L+(yas4424U-yas4424L)/2);

   if yas4420 not in (1,2) or yas4422 in (-1,-2) then do;

      if 1<=yas4426<=7 then FLAG_banksav=2;

      if yas4426=1 then banksav=500;

      if yas4426=2 then banksav=1750;

      if yas4426=3 then banksav=3750;

      if yas4426=4 then banksav=7500;

      if yas4426=5 then banksav=17500;

      if yas4426=6 then banksav=37500;

      if yas4426=7 then banksav=50001;

   end;

end;

if yas4400=-1 or yas4424L=-1 or yas4424U=-2 or yas4426=-1               then banksav=-1;

if yas4400=-2 or yas4424L=-2 or yas4424U=-2 or yas4426=-2               then banksav=-2;

if yas4400=-3 or yas4424L=-3 or yas4424U=-3 or yas4426=-3 or yas4422=-3 then banksav=-3;

 

 

*** If the respondent or his/her partner/spouse have other banksav in bonds or cds - bonds;

 

bonds=-4;

if yas4530 in (1,2,3) then do;

   FLAG_bonds=1;

   if yas4550=1 & yas4552>=0 then bonds=yas4552;

   if yas4550=2 & yas4554U>=0 & yas4554L>=0 then bonds=(yas4554L+(yas4554U-yas4554L)/2);

   if yas4550 not in (1,2) or yas4552 in (-1,-2) then do;

      if 1<=yas4556<=7 then FLAG_bonds=2;

      if yas4556=1 then bonds=500;

      if yas4556=2 then bonds=1750;

      if yas4556=3 then bonds=3750;

      if yas4556=4 then bonds=7500;

      if yas4556=5 then bonds=17500;

      if yas4556=6 then bonds=37500;

      if yas4556=7 then bonds=50001;

   end;

end;

if yas4530=-1 or yas4554L=-1 or yas4554U=-1 or yas4556=-1               then bonds=-1;

if yas4530=-2 or yas4554L=-2 or yas4554U=-2 or yas4556=-2               then bonds=-2;

if yas4530=-3 or yas4554L=-3 or yas4554U=-3 or yas4556=-3 or yas4552=-3 then bonds=-3;

 

 

*** If the respondent or his/her partner/spouse have stocks, mutual funds - stocks;

 

stocks=-4;

if yas4660 in (1,2,3) then do;

   FLAG_stocks=1;

   if yas4680=1 & yas4682>=0 then stocks=yas4682;

   if yas4680=2 & yas4684L>=0 & yas4684U>=0 then stocks=(yas4684L+(yas4684U-yas4684L)/2);

   if yas4680 not in (1,2) or yas4682 in (-1,-2) then do;

      if 1<=yas4686<=7 then FLAG_stocks=2;

      if yas4686=1 then stocks=500;

      if yas4686=2 then stocks=1750;

      if yas4686=3 then stocks=3750;

      if yas4686=4 then stocks=7500;

      if yas4686=5 then stocks=17500;

      if yas4686=6 then stocks=37500;

      if yas4686=7 then stocks=50001;

   end;

end;

if yas4660=-1 or yas4684L=-1 or yas4684U=-1 or yas4686=-1               then stocks=-1;

if yas4660=-2 or yas4684L=-2 or yas4684U=-2 or yas4686=-2               then stocks=-2;

if yas4660=-3 or yas4684L=-3 or yas4684U=-3 or yas4686=-3 or yas4682=-3 then stocks=-3;

 

 

*** If the respondent alone or respondent and his/her partner/spouse jointly own vehicles,

    their present value - pvcars;

 

pvcars=-4;

if yas4790 in (1,2,3) then do;

   FLAG_pvcars=1;

   if yas4810=1 & yas4812>=0 then pvcars=yas4812;

   if yas4810=2 & yas4814L>=0 & yas4814U>=0 then pvcars=(yas4814L+(yas4814U-yas4814L)/2);

   if yas4810 not in (1,2) or yas4812 in (-1,-2) then do;

      if 1<=yas4816<=7 then FLAG_pvcars=2;

      if yas4816=1 then pvcars=2500;

      if yas4816=2 then pvcars=7500;

      if yas4816=3 then pvcars=17500;

      if yas4816=4 then pvcars=37500;

      if yas4816=5 then pvcars=75000;

      if yas4816=6 then pvcars=175000;

      if yas4816=7 then pvcars=250001;

   end;

end;

if yas4790=-1 or yas4814L=-1 or yas4814U=-1 or yas4816=-1               then pvcars=-1;

if yas4790=-2 or yas4814L=-2 or yas4814U=-2 or yas4816=-2               then pvcars=-2;

if yas4790=-3 or yas4814L=-3 or yas4814U=-3 or yas4816=-3 or yas4812=-3 then pvcars=-3;

 

 

*** If the respondent alone or respondent and his/her partner/spouse jointly own furniture,

    its present value - pvfurn;

 

pvfurn=-4;

if yas4870>-4 then FLAG_pvfurn=1;

if yas4870=1 then pvfurn=2500;

if yas4870=2 then pvfurn=7500;

if yas4870=3 then pvfurn=17500;

if yas4870=4 then pvfurn=37500;

if yas4870=5 then pvfurn=75000;

if yas4870=6 then pvfurn=175000;

if yas4870=7 then pvfurn=250001;

if yas4870=-1 then pvfurn=-1;

if yas4870=-2 then pvfurn=-2;

if yas4870=-3 then pvfurn=-3;

 

 

*** If the respondent alone or respondent and his/her partner/spouse jointly own other assets not

    mentioned before - othsav;

 

othsav=-4;

if yas4880 in (1,2,3) then do;

   FLAG_othsav=1;

   if yas4900=1 & yas4902>=0 then othsav=yas4902;

   if yas4900=2 & yas4904L>=0 & yas4904U>=0 then othsav=(yas4904L+(yas4904U-yas4904L)/2);

   if yas4900 not in (1,2) or yas4902 in (-1,-2) then do;

       if 1<=yas4906<=7 then FLAG_othsav=2;

       if yas4906=1 then othsav=2500;

       if yas4906=2 then othsav=7500;

       if yas4906=3 then othsav=17500;

       if yas4906=4 then othsav=37500;

       if yas4906=5 then othsav=75000;

       if yas4906=6 then othsav=175000;

       if yas4906=7 then othsav=250001;

   end;

end;

if yas4880=-1 or yas4904L=-1 or yas4904U=-1 or yas4906=-1               then othsav=-1;

if yas4880=-2 or yas4904L=-2 or yas4904U=-2 or yas4906=-2               then othsav=-2;

if yas4880=-3 or yas4904L=-3 or yas4904U=-3 or yas4906=-3 or yas4902=-3 then othsav=-3;

 

 

************* LIABILITIES;

 

*** If there is mortgag or land contract on the aforementioned land or property - mortgag;

 

mortgag=-4;

if yas3740 in (1,2) then do;

   FLAG_mortgag=1;

   if yas3750=1 & yas3752>=0 then mortgag=yas3752;

   if yas3750=2 & yas3754L>=0 & yas3754U>=0 then mortgag=(yas3754L+(yas3754U-yas3754L)/2);

   if yas3750 not in (1,2) or yas3752 in (-1,-2) then do;

      if 1<=yas3756<=7 then FLAG_mortgag=2;

      if yas3756=1 then mortgag=500;

      if yas3756=2 then mortgag=1750;

      if yas3756=3 then mortgag=3750;

      if yas3756=4 then mortgag=7500;

      if yas3756=5 then mortgag=17500;

      if yas3756=6 then mortgag=37500;

      if yas3756=7 then mortgag=50001;

   end;

end;

if yas3740=-1 or yas3754L=-1 or yas3754U=-1 or yas3756=-1               then mortgag=-1;

if yas3740=-2 or yas3754L=-2 or yas3754U=-2 or yas3756=-2               then mortgag=-2;

if yas3740=-3 or yas3754L=-3 or yas3754U=-3 or yas3756=-3 or yas3752>=0 then mortgag=-3;

 

 

*** If the respondent or his/her partner/spouse has unpaid loans from Round 6 (yas3840=1 & yas3850=1)

     or still owes loans taken SDLI on house (yas3860=1) then total amount owed - resdebt;

 

resdebt=-4;

if (yas3840=1 & yas3850=1) or yas3860=1 then do;

   FLAG_resdebt=1;

   if yas3880=1 & yas3882>=0 then resdebt=yas3882;

   if yas3880=2 & yas3884U>=0 & yas3884L>=0 then resdebt=(yas3884L+(yas3884U-yas3884L)/2);

   if yas3880 not in (1,2) or yas3882 in (-1,-2) then do;

      if 1<=yas3886<=7 then FLAG_resdebt=2;

      if yas3886=1 then resdebt=500;

      if yas3886=2 then resdebt=1750;

      if yas3886=3 then resdebt=3750;

      if yas3886=4 then resdebt=7500;

      if yas3886=5 then resdebt=17500;

      if yas3886=6 then resdebt=37500;

      if yas3886=7 then resdebt=50001;

   end;

end;

if yas3850=-1 or yas3860=-1 or yas3884L=-1 or yas3884U=-1 or yas3886=-1               then resdebt=-1;

if yas3850=-2 or yas3860=-2 or yas3884L=-2 or yas3884U=-2 or yas3886=-2               then resdebt=-2;

if yas3850=-3 or yas3860=-3 or yas3884L=-3 or yas3884U=-3 or yas3886=-3 or yas3882=-3 then resdebt=-3;

 

 

*** If the respondent or his/her partner/spouse have second mortgages - othmort;

 

othmort=-4;

if yas3910=1 then do;

   FLAG_othmort=1;

   if yas3920=1 & yas3922>=0 then othmort=yas3922;

   if yas3920=2 & yas3924U>=0 & yas3924L>=0 then othmort=(yas3924L+(yas3924U-yas3924L)/2);

   if yas3920 not in (1,2) or yas3922 in (-1,-2) then do;

      if 1<=yas3926<=7 then FLAG_othmort=2;

      if yas3926=1 then othmort=500;

      if yas3926=2 then othmort=1750;

      if yas3926=3 then othmort=3750;

      if yas3926=4 then othmort=7500;

      if yas3926=5 then othmort=17500;

      if yas3926=6 then othmort=37500;

      if yas3926=7 then othmort=50001;

   end;

end;

if yas3910=-1 or yas3924L=-1 or yas3924U=-1 or yas3926=-1               then othmort=-1;

if yas3910=-2 or yas3924L=-2 or yas3924U=-2 or yas3926=-2               then othmort=-2;

if yas3910=-3 or yas3924L=-3 or yas3924U=-3 or yas3926=-3 or yas3922=-3 then othmort=-3;

 

 

*** If the respondent or his/her partner/spouse still owe money on these vehicles - cardebt;

 

cardebt=-4;

if yas4840>-4 then FLAG_cardebt=1;

if yas4840=1 & yas4842>=0 then cardebt=yas4842;

if yas4840=2 & yas4844L>=0 & yas4844U>=0 then cardebt=(yas4844L+(yas4844U-yas4844L)/2);

if yas4840 not in (1,2) or yas4842 in (-1,-2) then do;

   if 1<=yas4846<=7 then FLAG_cardebt=2;

   if yas4846=1 then cardebt=2500;

   if yas4846=2 then cardebt=7500;

   if yas4846=3 then cardebt=17500;

   if yas4846=4 then cardebt=37500;

   if yas4846=5 then cardebt=75000;

   if yas4846=6 then cardebt=175000;

   if yas4846=7 then cardebt=250001;

end;

if yas4790=-1 or yas4844L=-1 or yas4844U=-1 or yas4846=-1               then cardebt=-1;

if yas4790=-2 or yas4844L=-2 or yas4844U=-2 or yas4846=-2               then cardebt=-2;

if yas4790=-3 or yas4844L=-3 or yas4844U=-3 or yas4846=-3 or yas4842=-3 then cardebt=-3;

 

*** If the respondent still owes money on student loans from family/friend - famstdydebt;

 

famstdydebt=-4;

if yas5011A>-4 then FLAG_famstdydebt=1;

if yas5011A=1 & yas5012>=0 then famstdydebt=yas5012;

if yas5011A~=1 or yas5012 in (-1,-2) then do;

   if 1<=yas5014<=7 then FLAG_famstdydebt=2;

   if yas5014=1 then famstdydebt=500;

   if yas5014=2 then famstdydebt=1750;

   if yas5014=3 then famstdydebt=3750;

   if yas5014=4 then famstdydebt=7500;

   if yas5014=5 then famstdydebt=17500;

   if yas5014=6 then famstdydebt=37500;

   if yas5014=7 then famstdydebt=50001;

end;

if yas5014=-1 or yas5011A=-1        then famstdydebt=-1;

if yas5014=-2 or yas5011A=-2        then famstdydebt=-2;

if yas5014=-3 or yas5011A in (2,-3) then famstdydebt=-3;

 

*** If the respondent still owes money on student loans from govt. - govstdydebt;

govstdydebt=-4;

if yas5015A>-4 then FLAG_govstdydebt=1;

if yas5015A=1 & yas5016>=0 then govstdydebt=yas5016;

if yas5015A~=1 or yas5016 in (-1,-2) then do;

   if 1<=yas5018<=7 then FLAG_govstdydebt=2;

   if yas5018=1 then govstdydebt=500;

   if yas5018=2 then govstdydebt=1750;

   if yas5018=3 then govstdydebt=3750;

   if yas5018=4 then govstdydebt=7500;

   if yas5018=5 then govstdydebt=17500;

   if yas5018=6 then govstdydebt=37500;

   if yas5018=7 then govstdydebt=50001;

end;

if yas5018=-1 or yas5015A=-1        then govstdydebt=-1;

if yas5018=-2 or yas5015A=-2        then govstdydebt=-2;

if yas5018=-3 or yas5015A in (2,-3) then govstdydebt=-3;

 

*** If the respondent still owes loans to family or relatives - famdebt;

 

array famdebt  (20) famdebt01-famdebt20;

array yas5080  (20) yas508001-yas508020;

array yas5082  (20) yas508201-yas508220;

array yas5084L (20) yas5084L01-yas5084L20;

array yas5084U (20) yas5084U01-yas5084U20;

array yas5086  (20) yas508601-yas508620;

array yas5170  (20) yas517001-yas517020;

array yas5172  (20) yas517201-yas517220;

array yas5174L (20) yas5174L01-yas5174L20;

array yas5174U (20) yas5174U01-yas5174U20;

array yas5176  (20) yas517601-yas517620;

 

array yas5074  (20) yas507401-yas507420;

array yas5164  (20) yas516401-yas516420;

 

do i=1 to dim(famdebt);

   famdebt(i)=-4;

   * R was NOT loaned money from family/friends at last assets interview but has been loaned SDLI;

   if yas5040=1 then do;

      FLAG_famdebt=1.1;

      if yas5080(i)=1 & yas5082(i)>=0 then famdebt(i)=yas5082(i);

      if yas5080(i)=2 & yas5084L(i)>=0 & yas5084U(i)>=0

      then famdebt(i)=(yas5084L(i)+(yas5084U(i)-yas5084L(i))/2);

      if yas5080(i) not in (1,2) or yas5082(i) in (-1,-2) then do;

         if 1<=yas5086(i)<=7 then FLAG_famdebt=2.1;

         if yas5086(i)=1 then famdebt(i)=500;

             if yas5086(i)=2 then famdebt(i)=1750;

             if yas5086(i)=3 then famdebt(i)=3750;

             if yas5086(i)=4 then famdebt(i)=7500;

             if yas5086(i)=5 then famdebt(i)=17500;

             if yas5086(i)=6 then famdebt(i)=37500;

             if yas5086(i)=7 then famdebt(i)=50001;

      end;

   end;

   if yas5040=-1 or yas5074(i)=-1 or yas5086(i)=-1 or yas5084L(i)=-1 or yas5084U(i)=-1                  then famdebt(i)=-1;

   if yas5040=-2 or yas5074(i)=-2 or yas5086(i)=-2 or yas5084L(i)=-2 or yas5084U(i)=-2                  then famdebt(i)=-2;

   if yas5040=-3 or yas5074(i)=-3 or yas5086(i)=-3 or yas5084L(i)=-3 or yas5084U(i)=-3 or yas5082(i)=-3 then famdebt(i)=-3;

  

   * R was loaned money from family/friends at last assets interview and has also been loaned SDLI;

   if yas5130=1 then do;

      FLAG_famdebt=1.2;

      if yas5170(i)=1 & yas5172(i)>=0 then famdebt(i)=yas5172(i);

      if yas5170(i)=2 & yas5174L(i)>=0 & yas5174U(i)>-0

      then famdebt(i)=(yas5174L(i)+(yas5174U(i)-yas5174L(i))/2);

      if yas5170(i) not in (1,2) or yas5172(i) in (-1,-2) then do;

         if 1<=yas5176(i)<=7 then FLAG_famdebt=2.2;

             if yas5176(i)=1 then famdebt(i)=500;

             if yas5176(i)=2 then famdebt(i)=1750;

             if yas5176(i)=3 then famdebt(i)=3750;

             if yas5176(i)=4 then famdebt(i)=7500;

             if yas5176(i)=5 then famdebt(i)=17500;

             if yas5176(i)=6 then famdebt(i)=37500;

             if yas5176(i)=7 then famdebt(i)=50001;

      end;

   end;

   if yas5130=-1 or yas5164(i)=-1 or yas5176(i)=-1 or yas5174L(i)=-1 or yas5174U(i)=-1                  then famdebt(i)=-1;

   if yas5130=-2 or yas5164(i)=-2 or yas5176(i)=-2 or yas5174L(i)=-2 or yas5174U(i)=-2                  then famdebt(i)=-2;

   if yas5130=-3 or yas5164(i)=-3 or yas5176(i)=-3 or yas5174L(i)=-3 or yas5174U(i)=-3 or yas5172(i)=-3 then famdebt(i)=-3;

end;

 

* Checks for cases when R does not know who lent R the money;

who=0;

if yas5060=1|yas5062=1 then who=1;

if yas5150=1|yas5152=1 then who=2;

 

 

*** If the respondent or his/her partner/spouse jointly have other debts from loans, credit cards, etc;

 

othdebt=-4;

if yas5210=1 then do;

   FLAG_othdebt=1;

   if yas5220=1 & yas5222>=0 then othdebt=yas5222;

   if yas5220=2 & yas5224L>=0 & yas5224U>=0 then othdebt=(yas5224L+(yas5224U-yas5224L)/2);

   if yas5220 not in (1,2) or yas5222 in (-1,-2) then do;

      if 1<=yas5226<=7 then FLAG_othdebt=2;

      if yas5226=1 then othdebt=500;

      if yas5226=2 then othdebt=1750;

      if yas5226=3 then othdebt=3750;

      if yas5226=4 then othdebt=7500;

      if yas5226=5 then othdebt=17500;

      if yas5226=6 then othdebt=37500;

      if yas5226=7 then othdebt=50001;

   end;

end;

if yas5210=-1 or yas5224L=-1 or yas5224U=-1 or yas5226=-1               then othdebt=-1;

if yas5210=-2 or yas5224L=-2 or yas5224U=-2 or yas5226=-2               then othdebt=-2;

if yas5210=-3 or yas5224L=-3 or yas5224U=-3 or yas5226=-3 or yas5222=-3 then othdebt=-3;

 

 

************* Other calculations not necessary for computation of hhworthY;

 

*** If the respondent or his/her partner/spouse took loans from relatives or friends when bought or

    remodeled the residence - resdebt1. This is not important for computation of hhworthY as the amount

    still owed constitutes R's liabilities and not the entire amount taken as loan.;

 

resdebt1=-4;

if yas3790=1 then do;

   FLAG_resdebt1=1;

   if yas3810=1 & yas3812>=0 then resdebt1=yas3812;

   if yas3810=2 & yas3814U>=0 & yas3814L>=0 then resdebt1=(yas3814L+(yas3814U-yas3814L)/2);

   if yas3810 not in (1,2) or yas3812 in (-1,-2) then do;

      if 1<=yas3816<=7 then FLAG_resdebt1=2;

      if yas3816=1 then resdebt1=12500;

      if yas3816=2 then resdebt1=37500;

      if yas3816=3 then resdebt1=75000;

      if yas3816=4 then resdebt1=175000;

      if yas3816=5 then resdebt1=375000;

      if yas3816=6 then resdebt1=750000;

      if yas3816=7 then resdebt1=1000001;

   end;

end;

if yas3810=-1 or yas3790=-1 or yas3814L=-1 or yas3814U=-1 or yas3816=-1               then resdebt1=-1;

if yas3810=-2 or yas3790=-2 or yas3814L=-2 or yas3814U=-2 or yas3816=-2               then resdebt1=-2;

if yas3810=-3 or yas3790=-3 or yas3814L=-3 or yas3814U=-3 or yas3816=-3 or yas3812=-3 then resdebt1=-3;

 

 

*** If the respondent or his/her partner/spouse still have to pay taxes on the property - proptax;

 

proptax=-4;

if yas3950=1 then do;

   FLAG_proptax=1;

   if yas3960=1 & yas3962>=0 then proptax=yas3962;

   if yas3960=2 & yas3964U>=0 & yas3964L>=0 then proptax=(yas3964L+(yas3964U-yas3964L)/2);

   if yas3960 not in (1,2) or yas3962 in (-1,-2) then do;

      if 1<=yas3966<=7 then FLAG_proptax=2;

      if yas3966=1 then proptax=500;

      if yas3966=2 then proptax=1750;

      if yas3966=3 then proptax=3750;

      if yas3966=4 then proptax=7500;

      if yas3966=5 then proptax=17500;

      if yas3966=6 then proptax=37500;

      if yas3966=7 then proptax=50001;

   end;

end;

if yas3950=-1 or yas3964L=-1 or yas3964U=-1 or yas3966=-1               then proptax=-1;

if yas3950=-2 or yas3964L=-2 or yas3964U=-2 or yas3966=-2               then proptax=-2;

if yas3950=-3 or yas3964L=-3 or yas3964U=-3 or yas3966=-3 or yas3962=-3 then proptax=-3;

 

 

** Wrong input information.;

if PUBID=406 then do;

   banksav=3500;

   pvfurn=2500;

end;

 

 

*** Compute the respondent's household net worth (hhworthY).

    hhworthY=assets-liabilities.

    YAST-105 is the question determining whether respondents are asked the assets question;

 

array varsasst (*) pvranch pvmbst  pvmb    pvst    pvapt   pvbuss    othreal

                   retdsav banksav bonds   stocks  pvcars  pvfurn    othsav;

array varsliab (*) mortgag resdebt othmort cardebt famstdydebt govstdydebt othdebt famdebt01-famdebt20;

 

array flgsasst (*) flag_pvranch flag_pvmbst  flag_pvmb   flag_pvst   flag_pvapt  flag_pvbuss flag_othreal

                   flag_retdsav flag_banksav flag_bonds  flag_stocks flag_pvcars flag_pvfurn flag_othsav;

array flgsliab (*) flag_mortgag flag_resdebt flag_othmort flag_cardebt flag_famstdydebt flag_govstdydebt

                   flag_othdebt flag_famdebt flag_famdebt flag_famdebt flag_famdebt     flag_famdebt  

                   flag_famdebt flag_famdebt flag_famdebt flag_famdebt flag_famdebt     flag_famdebt  

                   flag_famdebt flag_famdebt flag_famdebt flag_famdebt flag_famdebt     flag_famdebt  

                   flag_famdebt flag_famdebt flag_famdebt;

 

if (yas105=0 or yas105=1) then do;

 

   hhworthY=0; assets=0; liabilities=0;

 

   do i=1 to dim(varsasst);

      if varsasst(i)>=0 then assets=assets+varsasst(i);

      if varsasst(i) in (-1,-2,-3) then flgsasst(i)=-3;

   end;

 

   do i=1 to dim(varsliab);

      if varsliab(i)>=0 then liabilities=liabilities+varsliab(i);

      if varsliab(i) in (-1,-2,-3) then flgsliab(i)=-3;

   end;

 

   hhworthY=assets-liabilities;

  

end;

 

 

*** Code hhworthY as a valid skip for those who were not asked the assets questions;

if yas105=-4 then do;

   hhworthY=-4;

   vskpHHY=1;

end;

 

*** Code hhworthY as an invalid skip for those who did not give valid responses;

do i=1 to dim(varsasst);

   if yas105=-1 or varsasst(i)=-1 then do;

      hhworthY=-1;

      invskpHHY=1;

   end;

end;

do i=1 to dim(varsliab);

   if yas105=-1 or varsliab(i)=-1 then do;

      hhworthY=-1;

      invskpHHY=1;

   end;

end;

 

do i=1 to dim(varsasst);

   if yas105=-2 or varsasst(i)=-2 then do;

      hhworthY=-2;

      invskpHHY=2;

   end;

end;

do i=1 to dim(varsliab);

   if yas105=-2 or varsliab(i)=-2 then do;

      hhworthY=-2;

      invskpHHY=2;

   end;

end;

 

do i=1 to dim(varsasst);

   if yas105=-3 or varsasst(i)=-3 then do;

      hhworthY=-3;

      invskpHHY=3;

   end;

end;

do i=1 to dim(varsliab);

   if yas105=-3 or varsliab(i)=-3 then do;

      hhworthY=-3;

      invskpHHY=3;

   end;

end;

 

*** HANDEDIT: These respondents gave a positive value for the lower limit but zero for the upper limit

              for some assets. So, code hhworthY as -3.;

if FLAG_range=1 then do;

   hhworthY=-3;

   invskpHHY=3;

end;

 

*** Code hhworthY as -5 for all those respondents who were not interviewed in Round 7;

if yas105=-5 then do;

   hhworthY=-5;

   nonintHHY=1;

end;

 

hhworthY=round(hhworthY,1);

 


/******************* SECTION 3:  HOUSEHOLD POVERTY STATUS *********************/

*** Create the poverty thresholds

     (taken from u.s.census' website - http://www.census.gov/hhes/poverty/threshld/thresh02.html);

 

 

povert=-4;

 

if hhsize=-1 or under18=-1 then povert=-1;

if hhsize=-2 or under18=-2 then povert=-2;

if hhsize=-3 or under18=-3 then povert=-3;

 

** Check if there are only children under 18 in the household - check these cases again.;

only_under18_HH=0;

if hhsize>0 & under18>0 & hhsize=under18 then only_under18_HH=1;

 

if hhsize=1 then do;

   if under18=0 then povert=9359;

   if under18=1 then povert=9359;

end;

 

if hhsize=2 then do;

   if under18=0 then povert=12047;

   if under18=1 then povert=12400;

   if under18=2 then povert=12400;

end;

 

if hhsize=3 then do;

   if under18=0 then povert=14072;

   if under18=1 then povert=14480;

   if under18=2 then povert=14494;

   if under18=3 then povert=14494;

end;

 

if hhsize=4 then do;

   if under18=0 then povert=18556;

   if under18=1 then povert=18859;

   if under18=2 then povert=18244;

   if under18=3 then povert=18307;

   if under18=4 then povert=18307;

end;

 

if hhsize=5 then do;

   if under18=0 then povert=22377;

   if under18=1 then povert=22703;

   if under18=2 then povert=22007;

   if under18=3 then povert=21469;

   if under18=4 then povert=21141;

   if under18=5 then povert=21141;

end;

 

if hhsize=6 then do;

   if under18=0 then povert=25738;

   if under18=1 then povert=25840;

   if under18=2 then povert=25307;

   if under18=3 then povert=24797;

   if under18=4 then povert=24038;

   if under18=5 then povert=23588;

   if under18=6 then povert=23588;

end;

 

if hhsize=7 then do;

   if under18=0 then povert=29615;

   if under18=1 then povert=29799;

   if under18=2 then povert=29162;

   if under18=3 then povert=28718;

   if under18=4 then povert=27890;

   if under18=5 then povert=26924;

   if under18=6 then povert=25865;

   if under18=7 then povert=25865;

end;

 

if hhsize=8 then do;

   if under18=0 then povert=33121;

   if under18=1 then povert=33414;

   if under18=2 then povert=32812;

   if under18=3 then povert=32285;

   if under18=4 then povert=31538;

   if under18=5 then povert=30589;

   if under18=6 then povert=29601;

   if under18=7 then povert=29350;

   if under18=8 then povert=29350;

end;

 

if hhsize>=9 then do;

   if under18=0  then povert=39843;

   if under18=1  then povert=40036;

   if under18=2  then povert=39504;

   if under18=3  then povert=39057;

   if under18=4  then povert=38323;

   if under18=5  then povert=37313;

   if under18=6  then povert=36399;

   if under18=7  then povert=36173;

   if under18>=8 then povert=34780;

end;

 

*** Compute the respondent's gross household income to poverty level ratio (povthr);

 

povthr=-4;

if groshhIY>=0 & povert>0 then povthr=round(((groshhIY*100)/povert),1);

 

*** Code povthr as an invalid skip for those with invalid income or household size.;

if groshhIY=-1 or povert=-1 then do;

   povthr=-1;

   invskpPOV=1;

end;

if groshhIY=-2 or povert=-2 then do;

   povthr=-2;

   invskpPOV=2;

end;

if groshhIY=-3 or povert=-3 then do;

   povthr=-3;

   invskpPOV=3;

end;

 

*** Code povthr as a valid skip for those without any gross income (-4 and not 0).;

if groshhIY=-4 then do;

   povthr=-4;

   vskpPOV=1;

end;

 

*** Code povthr as -5 for all those repondents who were not interviewed in round 7.;

if yas050=-5 then do;

   povthr=-5;

   nonintPOV=1;

end;

 

 

*** For checking, I create variables that will not be topcoded;

notopGIY=groshhIY;

notopHHY=hhworthY;

notopPOV=povthr;

 

if groshhIY=. then missGIY=1;

if hhworthY=. then missHHY=1;

if povthr=. then missPOV=1;


/******* SECTION 4:  TOPCODING INCOME, NET WORTH, AND POVERTY RATIO *******/

if hhworthY>=top_HHY98 then do;

   hhworthY=mean_top_HHY98;

   topHHY=1;

end;

if povthr>=top_POV98 then do;

   povthr=mean_top_POV98;

   topPOV=1;

end;

 

*** groshhIY and povthr have to be topcoded consistently. If only one of them is topcoded then it would

    be possible to calculate it from the other (which is not topcoded). We check whether such cases

    exist. If they do we topcode the variable which is not topcoded.;

chk1=0; chk2=0;

if groshhIY=mean_top_GIY98 & 0<=notopPOV<top_POV98 then chk1=1;

if groshhIY=mean_top_GIY98 & notopPOV<0 then chk1=2;

 

if povthr=mean_top_POV98 & 0<=notopGIY<top_GIY98 then chk2=1;

if povthr=mean_top_POV98 & notopGIY<0 then chk2=2;

 

 

*** Change all invalid skips to -3;

if groshhIY=-1 then groshhIY=-3;

if groshhIY=-2 then groshhIY=-3;

if hhworthY=-1 then hhworthY=-3;

if hhworthY=-2 then hhworthY=-3;

if povthr=-1 then povthr=-3;

if povthr=-2 then povthr=-3;

 

ENDSAS;

Return to top


Participation in Government Programs

Variables Created:

Variables Used

      These variables are listed in a separate file (due to the length of the list).

This program creates several variables describing the respondent's participation in government programs for the economically disadvantaged.  During the interview, respondents report amounts received and months of participation in Aid to Families with Dependent Children (AFDC); food stamps; and Women, Infants, and Children (WIC).  There is also an "other assistance" question to capture information about any other government program from which respondents may have received assistance.  The interview also records amounts received from unemployment compensation and worker's compensation in separate question series; this program also creates variables describing respondents' participation in unemployment or worker's compensation.

The program to create these variables first creates a month-by-month participation array for five of the six categories (AFDC, food stamps, WIC, and other programs; unemployment compensation is calculated separately, and the array is not created for worker's compensation).  These month-by-month variables constitute part of the event history array for program participation; see appendix 7 for more information.  After all arrays are created, the program merges data to create the summary variables. 

Because worker's compensation can be reported either as a lump sum received on a single day or as payments over the period of time that the respondent was not working, the month-by-month array variables are no longer created for this category of program participation.  The total benefits received in each calendar year are calculated, but the weeks and months that compensation were received are not created.

This program creates the variables that

  1. indicate the number of months in any particular year (from 1980 to 2004) that the respondent received any of the four programs - AFDC, WIC, FOOD STAMPS and OTHER programs: CV_GOVNT_PRG_YR.80-CV_GOVNT_PRG_YR.99, CV_GOVNT_PRG_YR.00-CV_GOVNT_PRG_YR.04

  2. indicate the TOTAL number of months that the respondent received any of the above four programs in a year (1980 to 2003) - CV_GOVNT_PRG_EVER

  3. indicate the amount received in any particular year (from 1980 to 2003) by the respondent in any of the above programs: CV_AMT_GOVNT_PCM_PCY.80-CV_AMT_GOVNT_PCM_PCY.99, CV_AMT_GOVNT_PCM_PCY.00-CV_AMT_GOVNT_PCM_PCY.04

 

***** Create dataset for those interviewed and eligible for program participation;

if p1210>-4;

 

HE=0;

array dtps (*) dtps1-dtps8;

array dtp1 (*) dtp1a dtp1w dtp1f dtp1o;

array dtp2 (4,8) dtp2a11-dtp2a14 dtp2a21-dtp2a24

                 dtp2w11-dtp2w14 dtp2w21-dtp2w24

                 dtp2f11-dtp2f14 dtp2f21-dtp2f24

                 dtp2o11-dtp2o14 dtp2o21-dtp2o24;

array dtp3 (4,8) dtp3a11-dtp3a14 dtp3a21-dtp3a24

                 dtp3w11-dtp3w14 dtp3w21-dtp3w24

                 dtp3f11-dtp3f14 dtp3f21-dtp3f24

                 dtp3o11-dtp3o14 dtp3o21-dtp3o24;

array dtp4 (*) dtp4a dtp4w dtp4f dtp4o;

array dtp5 (*) dtp5a dtp5w dtp5f dtp5o;

array dtp6 (*) dtp6a dtp6w dtp6f dtp6o;

array dtp7 (*) dtp7a dtp7w dtp7f dtp7o;

array dtp8 (*) dtp8a dtp8w dtp8f dtp8o;

 

 

do i=1 to dim(dtps);

   dtps(i)=0;

end;

do p=1 to 4;

   dtp1(p)=0; dtp4(p)=0; dtp5(p)=0;

   dtp6(p)=0; dtp7(p)=0; dtp8(p)=0;

   do q=1 to 8;

      dtp2(p,q)=0; dtp3(p,q)=0;

   end;

end;

 

** Note: Abbreviations used in this program are as follows:

   DLI  - Date of last interview

   DCI  - Date of current interview

   SDLI - Since date of last interview

   NVPR - Never Prior - NVPR

   AFDC - Aid to Families with Dependent Children

   WIC  - Women, Infants and Children

   FST  - Food Stamps

   OTH  - Other Assistance

   CV   - Created Variables

   CMS    - Continuous month scheme (dates are counted as months from January 1, 1980)

   YYYYMM - 4-digit year followed by 2-digit month;

 

 

************************************************ PART I ************************************************

**  Define all the arrays used in this program                                                        **

 

** (1) Created Variables;

array GPRTTL (25) GPRTTL80-GPRTTL99 GPRTTL00 GPRTTL01-GPRTTL04;

array GPATTL (25) GPATTL80-GPATTL99 GPATTL00 GPATTL01-GPATTL04;

 

 

** (2) Information from prior rounds;

 

* Interview month.;

array intmR (6) intmR1-intmR6;

 

* Interview year.;

array intyR (6) intyR1-intyR6;

 

* no. of months ever received.;

array gpevR   (6)    gpevR1-gpevR6;

 

* no. of months received in a given year.;

array gprttlR (6,25) gpr1ttl80-gpr1ttl99 gpr1ttl00 gpr1ttl01-gpr1ttl04

                     gpr2ttl80-gpr2ttl99 gpr2ttl00 gpr2ttl01-gpr2ttl04

                     gpr3ttl80-gpr3ttl99 gpr3ttl00 gpr3ttl01-gpr3ttl04

                     gpr4ttl80-gpr4ttl99 gpr4ttl00 gpr4ttl01-gpr4ttl04

                     gpr5ttl80-gpr5ttl99 gpr5ttl00 gpr5ttl01-gpr5ttl04

                     gpr6ttl80-gpr6ttl99 gpr6ttl00 gpr6ttl01-gpr6ttl04;

 

* amount received in a given year.;

array gpattlR (6,25) gpa1ttl80-gpa1ttl99 gpa1ttl00 gpa1ttl01-gpa1ttl04

                     gpa2ttl80-gpa2ttl99 gpa2ttl00 gpa2ttl01-gpa2ttl04

                     gpa3ttl80-gpa3ttl99 gpa3ttl00 gpa3ttl01-gpa3ttl04

                     gpa4ttl80-gpa4ttl99 gpa4ttl00 gpa4ttl01-gpa4ttl04

                     gpa5ttl80-gpa5ttl99 gpa5ttl00 gpa5ttl01-gpa5ttl04 

                     gpa6ttl80-gpa6ttl99 gpa6ttl00 gpa6ttl01-gpa6ttl04;

 

* start date for each spell;

array csmR (6,4,4) csmaR1_1-csmaR1_4 csmwR1_1-csmwR1_4 csmfR1_1-csmfR1_4 csmoR1_1-csmoR1_4

                   csmaR2_1-csmaR2_4 csmwR2_1-csmwR2_4 csmfR2_1-csmfR2_4 csmoR2_1-csmoR2_4

                   csmaR3_1-csmaR3_4 csmwR3_1-csmwR3_4 csmfR3_1-csmfR3_4 csmoR3_1-csmoR3_4

                   csmaR4_1-csmaR4_4 csmwR4_1-csmwR4_4 csmfR4_1-csmfR4_4 csmoR4_1-csmoR4_4

                   csmaR5_1-csmaR5_4 csmwR5_1-csmwR5_4 csmfR5_1-csmfR5_4 csmoR5_1-csmoR5_4

                   csmaR6_1-csmaR6_4 csmwR6_1-csmwR6_4 csmfR6_1-csmfR6_4 csmoR6_1-csmoR6_4;

 

* stop date for each spell;

array cemR (6,4,4) cemaR1_1-cemaR1_4 cemwR1_1-cemwR1_4 cemfR1_1-cemfR1_4 cemoR1_1-cemoR1_4

                   cemaR2_1-cemaR2_4 cemwR2_1-cemwR2_4 cemfR2_1-cemfR2_4 cemoR2_1-cemoR2_4

                   cemaR3_1-cemaR3_4 cemwR3_1-cemwR3_4 cemfR3_1-cemfR3_4 cemoR3_1-cemoR3_4

                   cemaR4_1-cemaR4_4 cemwR4_1-cemwR4_4 cemfR4_1-cemfR4_4 cemoR4_1-cemoR4_4

                   cemaR5_1-cemaR5_4 cemwR5_1-cemwR5_4 cemfR5_1-cemfR5_4 cemoR5_1-cemoR5_4

                   cemaR6_1-cemaR6_4 cemwR6_1-cemwR6_4 cemfR6_1-cemfR6_4 cemoR6_1-cemoR6_4;

 

* edit flag for dates for each spell;

array eflR (6,4,4) eflaR1_1-eflaR1_4 eflwR1_1-eflwR1_4 eflfR1_1-eflfR1_4 efloR1_1-efloR1_4

                   eflaR2_1-eflaR2_4 eflwR2_1-eflwR2_4 eflfR2_1-eflfR2_4 efloR2_1-efloR2_4

                   eflaR3_1-eflaR3_4 eflwR3_1-eflwR3_4 eflfR3_1-eflfR3_4 efloR3_1-efloR3_4

                   eflaR4_1-eflaR4_4 eflwR4_1-eflwR4_4 eflfR4_1-eflfR4_4 efloR4_1-efloR4_4

                   eflaR5_1-eflaR5_4 eflwR5_1-eflwR5_4 eflfR5_1-eflfR5_4 efloR5_1-efloR5_4

                   eflaR6_1-eflaR6_4 eflwR6_1-eflwR6_4 eflfR6_1-eflfR6_4 efloR6_1-efloR6_4;

 

* edit flag for amounts for each spell;

array aflR (6,4,4) aflaR1_1-aflaR1_4 aflwR1_1-aflwR1_4 aflfR1_1-aflfR1_4 afloR1_1-afloR1_4

                   aflaR2_1-aflaR2_4 aflwR2_1-aflwR2_4 aflfR2_1-aflfR2_4 afloR2_1-afloR2_4

                   aflaR3_1-aflaR3_4 aflwR3_1-aflwR3_4 aflfR3_1-aflfR3_4 afloR3_1-afloR3_4

                   aflaR4_1-aflaR4_4 aflwR4_1-aflwR4_4 aflfR4_1-aflfR4_4 afloR4_1-afloR4_4

                   aflaR5_1-aflaR5_4 aflwR5_1-aflwR5_4 aflfR5_1-aflfR5_4 afloR5_1-afloR5_4

                   aflaR6_1-aflaR6_4 aflwR6_1-aflwR6_4 aflfR6_1-aflfR6_4 afloR6_1-afloR6_4;

 

** (3) Intermediate variables - most recent created variables available from prior rounds.;

 

* ogpev - no. of months ever received.;

 

* no. of months recd., yearly;

array ogprttl (25) ogprttl80-ogprttl99 ogprttl00 ogprttl01-ogprttl04;

 

* amount recd., yearly;

array ogpattl (25) ogpattl80-ogpattl99 ogpattl00 ogpattl01-ogpattl04;

 

* start date;

array ocsm (4)  ocsma ocsmw ocsmf ocsmo;

 

* stop date;

array ocem (4)  ocema ocemw ocemf ocemo;

 

* edit flag for dates;

array oefl (4)  oefla oeflw oeflf oeflo;

 

* edit flag for amounts;

array oafl (4)  oafla oaflw oaflf oaflo;

 

** (4) Information available from current round.;

 

* START YEAR;

array ys (4,8)     ps35800y1-ps35800y4 p16700y1-p16700y4

                   ps22000y1-ps22000y4 p22000y1-p22000y4

                   ps19100y1-ps19100y4 p19400y1-p19400y4

                   ps31000y1-ps31000y4 p31000y1-p31000y4;

 

* START MONTH;

array ms (4,8)     ps35800m1-ps35800m4 p16700m1-p16700m4

                   ps22000m1-ps22000m4 p22000m1-p22000m4

                   ps19100m1-ps19100m4 p19400m1-p19400m4

                   ps31000m1-ps31000m4 p31000m1-p31000m4;

 

* END YEAR;

array ye (4,8)     ps35840y1-ps35840y4 p17200y1-p17200y4

                   ps22600y1-ps22600y4 p22600y1-p22600y4

                   ps20000y1-ps20000y4 p20000y1-p20000y4

                   ps31600y1-ps31600y4 p31600y1-p31600y4;

 

 

* END MONTH;

array me (4,8)     ps35840m1-ps35840m4 p17200m1-p17200m4

                   ps22600m1-ps22600m4 p22600m1-p22600m4

                   ps20000m1-ps20000m4 p20000m1-p20000m4

                   ps31600m1-ps31600m4 p31600m1-p31600m4;

 

* CURRENTLY RECEIVING - NO GAPS;

array cur (4,8)    ps359501-ps359504   p169001-p169004

                   ps23700a1-ps23700a4 p222001-p222004

                   ps21100a1-ps21100a4 p196001-p196004

                   ps32700a1-ps32700a4 p312001-p312004;

 

* CURRENTLY RECEIVING - RETRO;

array cwks (4,8)   ps35740 ps35740 ps35740 ps35740 p16200 p16200 p16200 p16200

                   ps21430 ps21430 ps21430 ps21430 p21500 p21500 p21500 p21500

                   ps16410 ps16410 ps16410 ps16410 p18900 p18900 p18900 p18900

                   ps36120 ps36120 ps36120 ps36120 p30500 p30500 p30500 p30500;

 

* PERSON was RECEIVING AT DLI, chk;

array dli (4,8)    ps357901  duma2-duma8

                   ps21900a1 dumw2-dumw8

                   ps19063a1 dumf2-dumf8

                   ps30900a1 dumo2-dumo8;

 

* AMOUNT RECEIVED - ACTUAL;

array incm (4,8)   ps359001-ps359004  p181001-p181004

                   ps233001-ps233004  p233001-p233004

                   ps207001-ps207004  p207001-p207004

                   ps323001-ps323004  p323001-p323004;

 

* AMOUNT RECEIVED - ESTIMATED;  

array eincm (4,8)  ps359101-ps359104  p182001-p182004

                   ps234001-ps234004  p234001-p234004

                   ps208001-ps208004  p208001-p208004

                   ps324001-ps324004  p324001-p324004;

 

* ESTIMATED WEEKS - unable to answer start or stop quex;

array wks (4,8)    ps358601-ps358604  p175001-p175004

                   ps228001-ps228004  p228001-p228004

                   ps202001-ps202004  p202001-p202004

                   ps318001-ps318004  p318001-p318004;

 

* STOPPED FOR 1+ MONTH.;

array stpgp (4,8)  ps358301-ps358304 p170001-p170004

                   ps223001-ps223004 p223001-p223004

                   ps197001-ps197004 p197001-p197004

                   ps313001-ps313004 p313001-p313004;

 

* RECEIVE AGAIN (after stopping for 1+ month)?;

array recag (4,8)  ps359601-ps359604 p186001-p186004

                   ps238001-ps238004 p238001-p238004

                   ps212001-ps212004 p212001-p212004

                   ps329001-ps329004 p329001-p329004;

 

* PERSON RECEIVING, RESPONDENT;

array rcvr (4,8)   ps359201_1-ps359201_4 p183001_1-p183001_4

                   ps235001_1-ps235001_4 p235001_1-p235001_4

                   ps209001_1-ps209001_4 p209001_1-p209001_4

                   ps325001_1-ps325001_4 p325001_1-p325001_4;

 

* PERSON RECEIVING, SPOUSE;

array rcvs (4,8)   ps359202_1-ps359202_4 p183002_1-p183002_4

                   ps235002_1-ps235002_4 p235002_1-p235002_4

                   ps209002_1-ps209002_4 p209002_1-p209002_4

                   ps325002_1-ps325002_4 p325002_1-p325002_4;

 

* PERSON RECEIVING, CHILD;

array rcvc (4,8)   ps359203_1-ps359203_4 p183003_1-p183003_4

                   ps235003_1-ps235003_4 p235003_1-p235003_4

                   ps209003_1-ps209003_4 p209003_1-p209003_4

                   ps325003_1-ps325003_4 p325003_1-p325003_4;

 

* PERSON RECEIVING, FAMILY MEMBER;

array rcvf (4,8)   ps359204_1-ps359204_4 p183004_1-p183004_4

                   ps235004_1-ps235004_4 p235004_1-p235004_4

                   ps209004_1-ps209004_4 p209004_1-p209004_4

                   ps325004_1-ps325004_4 p325004_1-p325004_4;

 

* PERSON RECEIVING, OTHER PERSON; 

array rcvo (4,8)   ps359205_1-ps359205_4 p183005_1-p183005_4

                   ps235005_1-ps235005_4 p235005_1-p235005_4

                   ps209005_1-ps209005_4 p209005_1-p209005_4

                   ps325005_1-ps325005_4 p325005_1-p325005_4;

 

 

** (5) Intermediate variables created based on information available from current round.;

 

* indicator for receipt, monthly.; * amount received, monthly.;      * person receiving, monthly.;    

array AREC (300) AREC001-AREC300;  array AAMT (300) AAMT001-AAMT300; array AHHM (300) AHHM001-AHHM300;

array WREC (300) WREC001-WREC300;  array WAMT (300) WAMT001-WAMT300; array WHHM (300) WHHM001-WHHM300;

array FREC (300) FREC001-FREC300;  array FAMT (300) FAMT001-FAMT300; array FHHM (300) FHHM001-FHHM300;

array OREC (300) OREC001-OREC300;  array OAMT (300) OAMT001-OAMT300; array OHHM (300) OHHM001-OHHM300;

 

array ALLAMT (4,300) AAMT001-AAMT300 WAMT001-WAMT300 FAMT001-FAMT300 OAMT001-OAMT300;

array ALLREC (4,300) AREC001-AREC300 WREC001-WREC300 FREC001-FREC300 OREC001-OREC300;

array ALLHHM (4,300) AHHM001-AHHM300 WHHM001-WHHM300 FHHM001-FHHM300 OHHM001-OHHM300;

 

* ttlg - no. of months ever received.;

 

* no. of months received, yearly.;

array gm  (25) gm80-gm99     gm00   gm01-gm04;

 

* amount received, yearly.;

array gamt(25) gamt80-gamt99 gamt00 gamt01-gamt04;

 

* no. of months with valid amounts.;

array ga  (25) ga80-ga99     ga00   ga01-ga04;

 

* no. of months with invalid amounts.;

array gn  (25) gn80-gn99     gn00   gn01-gn04;

 

* start date in YYYYMM scheme;                  

array yms (4,8)  ymsa11-ymsa14 ymsa21-ymsa24

                 ymsw11-ymsw14 ymsw21-ymsw24

                 ymsf11-ymsf14 ymsf21-ymsf24

                 ymso11-ymso14 ymso21-ymso24;   

                

* start date in CMS;

array csm (4,8)  csma11-csma14 csma21-csma24

                 csmw11-csmw14 csmw21-csmw24

                 csmf11-csmf14 csmf21-csmf24

                 csmo11-csmo14 csmo21-csmo24;                

                

* stop date in YYYYMM scheme;               

array yme (4,8)  ymea11-ymea14 ymea21-ymea24

                 ymew11-ymew14 ymew21-ymew24

                 ymef11-ymef14 ymef21-ymef24

                 ymeo11-ymeo14 ymeo21-ymeo24;

 

* stop date in CMS;

array cem (4,8)  cema11-cema14 cema21-cema24

                 cemw11-cemw14 cemw21-cemw24

                 cemf11-cemf14 cemf21-cemf24

                 cemo11-cemo14 cemo21-cemo24;                

                

* amount received;                                           

array inc (4,8)  inca11-inca14 inca21-inca24

                 incw11-incw14 incw21-incw24     

                 incf11-incf14 incf21-incf24     

                 inco11-inco14 inco21-inco24;    

    

* person receiving dummy;                   

array who (4,8)  whoa11-whoa14 whoa21-whoa24

                 whow11-whow14 whow21-whow24

                 whof11-whof14 whof21-whof24

                 whoo11-whoo14 whoo21-whoo24;

                

* estimated months;                                          

array mos (4,8)  mosa11-mosa14 mosa21-mosa24                 

                 mosw11-mosw14 mosw21-mosw24                 

                 mosf11-mosf14 mosf21-mosf24                 

                 moso11-moso14 moso21-moso24;                

                

* start month;                              

array nms (4,8)  nmsa11-nmsa14 nmsa21-nmsa24

                 nmsw11-nmsw14 nmsw21-nmsw24

                 nmsf11-nmsf14 nmsf21-nmsf24

                 nmso11-nmso14 nmso21-nmso24;

                

* date flag;                                                   

array efl (4,8)  efla11-efla14 efla21-efla24                  

                 eflw11-eflw14 eflw21-eflw24                  

                 eflf11-eflf14 eflf21-eflf24                  

                 eflo11-eflo14 eflo21-eflo24;                  

 

* amount flag;                                  

array afl (4,8)  afla11-afla14 afla21-afla24    

                 aflw11-aflw14 aflw21-aflw24    

                 aflf11-aflf14 aflf21-aflf24    

                 aflo11-aflo14 aflo21-aflo24;    

 

* date flag (when end date is before DLI);      

array nefl (4,8) nefla11-nefla14 nefla21-nefla24

                 neflw11-neflw14 neflw21-neflw24

                 neflf11-neflf14 neflf21-neflf24

                 neflo11-neflo14 neflo21-neflo24;

* age flag;                                     

array agfl (4,8) agfla11-agfla14 agfla21-agfla24

                 agflw11-agflw14 agflw21-agflw24

                 agflf11-agflf14 agflf21-agflf24

                 agflo11-agflo14 agflo21-agflo24;

 

** (6) Variables created for checking the created variables.;

 

* To check for spells that ended before DLI.;   

array edli (4,8) edlia11-edlia14 edlia21-edlia24

                 edliw11-edliw14 edliw21-edliw24

                 edlif11-edlif14 edlif21-edlif24

                 edlio11-edlio14 edlio21-edlio24;

 

* date flag to be used for checking "efl";

array eflC (4,8) eflCa11-eflCa14 eflCa21-eflCa24

                 eflCw11-eflCw14 eflCw21-eflCw24

                 eflCf11-eflCf14 eflCf21-eflCf24

                 eflCo11-eflCo14 eflCo21-eflCo24;

 

* To check for spells that have start dates before end dates.;                

array rvdt (4,8) rvdta11-rvdta14 rvdta21-rvdta24

                 rvdtw11-rvdtw14 rvdtw21-rvdtw24

                 rvdtf11-rvdtf14 rvdtf21-rvdtf24

                 rvdto11-rvdto14 rvdto21-rvdto24;

 

* To check for spells that have start dates before end dates.;                

array dtms (4,8) dtmsa11-dtmsa14 dtmsa21-dtmsa24

                 dtmsw11-dtmsw14 dtmsw21-dtmsw24

                 dtmsf11-dtmsf14 dtmsf21-dtmsf24

                 dtmso11-dtmso14 dtmso21-dtmso24;

 

 

* temporary start date in CMS;

array tcsm (4,8) tcsma11-tcsma14 tcsma21-tcsma24

                 tcsmw11-tcsmw14 tcsmw21-tcsmw24

                 tcsmf11-tcsmf14 tcsmf21-tcsmf24

                 tcsmo11-tcsmo14 tcsmo21-tcsmo24;

 

* temporary stop date in CMS;

array tcem (4,8) tcema11-tcema14 tcema21-tcema24

                 tcemw11-tcemw14 tcemw21-tcemw24

                 tcemf11-tcemf14 tcemf21-tcemf24

                 tcemo11-tcemo14 tcemo21-tcemo24;  

 

* temporary amount received;                           

array tinc (4,8) tinca11-tinca14 tinca21-tinca24 

                 tincw11-tincw14 tincw21-tincw24 

                 tincf11-tincf14 tincf21-tincf24 

                 tinco11-tinco14 tinco21-tinco24;

 

* temporary person receiving dummy;                   

array twho (4,8) twhoa11-twhoa14 twhoa21-twhoa24

                 twhow11-twhow14 twhow21-twhow24

                 twhof11-twhof14 twhof21-twhof24

                 twhoo11-twhoo14 twhoo21-twhoo24;

                

* temporary date flag;

array tefl (4,8) tefla11-tefla14 tefla21-tefla24

                 teflw11-teflw14 teflw21-teflw24

                 teflf11-teflf14 teflf21-teflf24

                 teflo11-teflo14 teflo21-teflo24;

 

* temporary amount flag;

array tafl (4,8) tafla11-tafla14 tafla21-tafla24

                 taflw11-taflw14 taflw21-taflw24

                 taflf11-taflf14 taflf21-taflf24

                 taflo11-taflo14 taflo21-taflo24;

 

array prgms1 (4) AFDC_SDLI WIC_SDLI FST_SDLI  OTH_SDLI; * Flag for whether program was reported in SDLI.;

array prgms2 (4) AFDC_NVPR WIC_NVPR FST_NVPR  OTH_NVPR; * Flag for whether program was reported in NVPR.;

array stdlis (4) stdlia stdliw stdlif stdlio; * Flag for progs whose spells started before DLI.;

array endlis (4) endlia endliw endlif endlio; * Flag for progs whose spells ended before DLI.;

array revdts (4) revdta revdtw revdtf revdto; * Flag for progs with spell st dts. later than end dts.;

array dtmiss (4) dtmisa dtmisw dtmisf dtmiso; * Flag for progs with either spell start/stop dts missing;

array ovp    (4) ovpa   ovpw   ovpf   ovpo;   * Flag for progs with overlapping spells.;

array whybt  (4) whybta whybtw whybtf whybto; * Flag for reporting in both SDLI and NVPR.;

array whodf  (4) whodfa whodfw whodff whodfo; * Flag for different person receiving overlapping spells.;

array whyms  (4) whymsa whymsw whymsf whymso; * Flag for non-rec. in CVs even though reported.;

array doipr  (4) doipra doiprw doiprf doipro; * Flag for receiving after DCI (as per CVs).;

array prgms  (4) AFDC   WIC    FST    OTH;    * Flag for program receipiency (as per CVs).;

 

 

************************************************ PART II ***********************************************

**  Initialize the created and intermediate variables at the value at DLI or 0. Create date of birth, **

**  DCI, DLI etc. in CMS and YYYYMM schemes.                                                          **

 

rnds=dim(csm,2);

rnds1=dim(csm,2)/2;

 

** Identify the last round that Respondent was interviewed (dli_rnd);

do i=1 to dim(intmR);

   if intmR(i)~=-5 then dli_rnd=i;

end;

 

** Intialize values of GPRTTL (& ogprttl), GPATTL (& ogpattl) and GPEV (& ogpev) by their values at the

   DLI;

do i=1 to dim(intmR);

   if i=dli_rnd then do;

      GPEV=gpevR(i);

      ogpev=gpevR(i);

      do j=1 to dim(GPRTTL);

         GPRTTL(j)=gprttlR(i,j);

         GPATTL(j)=gpattlR(i,j);

         ogprttl(j)=gprttlR(i,j);

         ogpattl(j)=gpattlR(i,j);

      end;

   end;

end;

 

** Identify the start and stop dates and edit flags for the most recent spell from prior rounds

   - ocsma ocsmw ocsmf ocsmo ocema ocemw ocemf ocemo

     oefla oeflw oeflf oeflo oafla oaflw oaflf oaflo;

   do i=1 to dim(csmR,1);

      do p=1 to dim(csmR,2);

         do t=1 to dim(csmR,3);

            if csmR(i,p,t)>-4 then do;

               ocsm(p)=csmR(i,p,t);

               ocem(p)=cemR(i,p,t);

               oefl(p)=eflR(i,p,t);

               oafl(p)=aflR(i,p,t);

            end;

         end;

      end;

   end;

           

  

  

** Change missing values and invalid skips of created variables in prior rounds to 0 to facilitate

   computation of created variables for this round.;

do j=1 to dim(GPRTTL);

   * although Respondent did not participate in govt. programs, the amount received variable is 0

     instead of -4.;

   if GPRTTL(j)=0 and GPATTL(j)=0 then ogpattl(j)=-4;

  

   * GPRTTL was not computed for anyone and so appears missing for all Respondent;

   if GPRTTL(j)=. or GPRTTL(j)=-4 then do;

      ogprttl(j)=-4;

      GPRTTL(j)=0;

   end;

 

   * GPATTL was not computed for anyone and so appears missing for all Respondent;

   if GPATTL(j)=. or GPATTL(j)=-4  then do;

      ogpattl(j)=-4;

      GPATTL(j)=0;

   end;

end;

  

** Initialize value of GPEV to 0 if it is a valid skip;

if GPEV=. or GPEV=-4 then do;

   ogpev=-4;

   GPEV=0;

end;

 

** Create important date variables in the two schemes - the YYYYMM scheme and CMS

   ymb   - Date of Birth in YYYYMM scheme

   cmb   - Date of Birth in CMS

   ym14  - Date of 14th birthday in YYYYMM scheme

   cm14  - Date of 14th birthday in CMS

   dliym - month after DLI in YYYYMM scheme

   dlicm - month after DLI in CMS

   cdli  - DLI in CMS

   iym   - DCI in YYYYMM scheme

   doicm - DCI in CMS

   mnthaf - month after CDI

   aaiym - Age at DCI in YYYYMM scheme

   aaicm - Age at DCI in CMS;

 

 

ymb=(doby*100)+dobm;

cmb=((doby-1980)*12)+dobm;

ym14=ymb+1400;

cm14=cmb+(14*12);

 

if inty>0 and intm>0 then do;

   iym=(inty*100)+intm;

   doicm=((inty-1980)*12)+intm;

   mnthaf=doicm+1;

   aaiym=iym-ymb;

   aaicm=doicm-cmb;

end;

if inty in (-1,-2,-3) or intm in (-1,-2,-3) then do;

   iym=-3;

   doicm=-3;

   aaiym=-3;

   aaicm=-3;

end;

 

if p1210=1 then do;

   do i=1 to dim(intmR);

      if i=dli_rnd then do;

         if intmR(i)<12 then dliym=(intyR(i)*100)+intmR(i)+1;

         if intmR(i)=12 then dliym=((intyR(i)+1)*100)+1;

         dlicm=((intyR(i)-1980)*12)+intmR(i)+1;

         cdli=((intyR(i)-1980)*12)+intmR(i);

      end;

   end;

end;

if p1210~=1 then do;

   dliym=ym14;

   dlicm=cm14;

   cdli=cm14-1;

end;

 

 

** Initialize values of the monthly variables to be created;

do l=cmb to doicm;

   AREC(l)=0;

   WREC(l)=0;

   FREC(l)=0;

   OREC(l)=0;

end;

 

** Initialize the following counters to zero. ;

ackr=0; wckr=0; fckr=0; ockr=0; * Counter for XREC>0  but XAMT in (.,-4).;

acka=0; wcka=0; fcka=0; ocka=0; * Counter for XREC=0  or  XHHM in (.,-4) but XAMT>-4;

ackh=0; wckh=0; fckh=0; ockh=0; * Counter for XREC=0  or  XAMT in (.,-4) but XHHM>-4;

ackv=0; wckv=0; fckv=0; ockv=0; * Counter for XREC=-3 but XAMT~=-3.;

aodttl=0; wodttl=0; fodttl=0; oodttl=0; * Counter for total no. of months received the problematic amts.;

 

 

*** Initialize variables;

** Merge values of "currently receiving" variable from two different sections of the questionnaire;

if ps35707>-3 then p16200=ps35707;             /* AFDC */

if ps21397>-3 then p21500=ps21397;             /* WIC */

if ps16377>-3 then p18900=ps16377;             /* FST */

if ps36087>-3 then p30500=ps36087;             /* OTH */

 

 

*********************************************** PART III ***********************************************

**  Create intermediate variables using informaiton from the current round.                           **

do p=1 to 4;                                                                                /** [B1] **/

   do q=1 to dim(csm,2);                                                                           /** [B2] **/

  

      *** Compute start and stop dates for a particular spell of a particular program in the YYYYMM

          and CMS formats;

      ***********************************************************************************************

      **  Define the start date and end dates.                                                      **

      **  (1) If Respondent reports still receiving, then use DCI as the temporary end date for    **

      **      the last loop reported. In the next survey round, Respondent will be asked if he/she **

      **      is still receiving. If not, then a permanent end date equivalent to the stop date    **

      **      reported in the next round will be assigned.                                         **

      **  (2) If start or end dates are missing, impute those dates. Users will be able to tell    **

      **      what was imputed by looking at the following participation flag variable created     **

      **      during the program.                                                                  **

      **      The categories are the following:                                                    **

      **           1=R reported participation dates                                                **

      **           2=start month imputed                                                           **

      **           3=start month and year imputed                                                  **

      **           4=stop month imputed                                                            **

      **           5=stop month and year imputed                                                   **

      **           6=start and stop dates imputed                                                  **

      **           7=error in data due to round 7 questionnaire problems or inconsistent response. **

      **             In both those these cases we are not sure whether Respondents received in     **

      **             these months or not.                                                          **

      **             QUESTIONNAIRE ERROR: These Respondents report a valid start and stop date but **

      **                                  are never asked the follow-up question - if they recd.   **

      **                                  again.                                                   **

      **             CONFLICTING RESPONSE: These Respondents report currently receiving, a valid   **

      **                                   start date and a valid stop date that is different from **

      **                                   the DCI but in the follow-up question as to whether     **

      **                                   they received again, they answer NO.                    **

      **********************************************************************************************;

 

 

      ** (1) Set start date if both start month and start year are valid;

 

      if ys(p,q)>0 and ms(p,q)>0 then yms(p,q)=(ys(p,q)*100)+ms(p,q);

     

      * set start date to DLI if receiving then;

      if dli(p,q)=1 then do;

         yms(p,q)=dliym;

         if cwks(p,q)=1 then do;

            yme(p,q)=iym;

            nogaps=p;

         end;

      end;

     

      * Set end date to DCI if currently receiving;

      if cur(p,q)=1 then yme(p,q)=iym;

 

      * Set end date if both end month and end year are valid;

      if ye(p,q)>0 and me(p,q)>0 then yme(p,q)=(ye(p,q)*100)+me(p,q);

     

      * If end month greater than DCI, constrain by DCI;

      if yme(p,q)>iym then yme(p,q)=iym;

     

      * Efl is not set if the end date is before DLI because in these cases we do not compute months

        receiving variable and so we compute another variable, nefl, instead. Nefl measures the same

        thing as efl;

      if yms(p,q)>0 and yme(p,q)>=dliym then efl(p,q)=1;

      if yms(p,q)>0 and 0<yme(p,q)<dliym then nefl(p,q)=1;

     

      * Determine months from estimated weeks variable;

      if wks(p,q)>=0 and (ys(p,q)<0 or ms(p,q)<0 or ye(p,q)<0 or me(p,q)<0) then do;

         mos(p,q)=floor(wks(p,q)/4.3);

      end;

 

      * Age edit flag;

      agfl(p,q)=0;

      if ys(p,q)>0 and ys(p,q)<1990 then agfl(p,q)=1;

 

 

      ** (2) If start year is known and month is unknown;

 

      if ys(p,q)>0 and -3<=ms(p,q)<=-1 then do;

 

         * If estimated weeks are known and currently receiving, then count backwards by the number of

            the estimated weeks from the DCI. If the number of estimated weeks falls short of the start

            year, the start month is December of that year. If the number of estimated weeks is past the

            start year, then the start month is January of that year.;

         if wks(p,q)>=0 and cwks(p,q)=1 then do; 

            yme(p,q)=iym;

            if 0<=mos(p,q)<=(intm-1) then yms(p,q)=iym-mos(p,q);

            do k=1 to 13;

               A=(k*88);

               if (intm+(k*12)-12)<=mos(p,q)<=(intm+(k*12)-1) then yms(p,q)=iym-A-mos(p,q);

            end;

            if yms(p,q)<((ys(p,q)*100)+01) then yms(p,q)=((ys(p,q)*100)+01);

            if yms(p,q)<dliym then yms(p,q)=dliym;

            if yms(p,q)>((ys(p,q)*100)+12) then yms(p,q)=((ys(p,q)*100)+12);

         end;

 

         * If estimated weeks missing and currently receiving then set end date to DCI and start date to

           Dec of start year;

         else if -3<=wks(p,q)<0 and cwks(p,q)=1 then do;

            yme(p,q)=iym;

            yms(p,q)=((ys(p,q)*100)+12);

            if yms(p,q)>iym then yms(p,q)=iym;

         end;

 

         * If estimated weeks missing and not currently receiving then set end date to Dec and start

           date to Jan of start year, constrain end date by DCI;

         else if -3<=wks(p,q)<0 and cwks(p,q)=0 then do;

            yms(p,q)=((ys(p,q)*100)+01);

            if yms(p,q)<dliym then yms(p,q)=dliym;

            if yms(p,q)>((ys(p,q)*100)+12) then yms(p,q)=((ys(p,q)*100)+12);

            if yme(p,q)=. then yme(p,q)=((ys(p,q)*100)+12);

            if yme(p,q)>iym then yme(p,q)=iym;

         end;

 

         * If estimated weeks are known and not currently receiving, then put start date as Jan of start

           year. Constrain by DLI. But finally constrain by Dec of start year. Then count forward by

           the number of estimated weeks from start date. Constrain end date by DCI;

         else if wks(p,q)>=0 and cwks(p,q)=0 then do;

            yms(p,q)=((ys(p,q)*100)+01);

            if yms(p,q)<dliym then yms(p,q)=dliym;

            nms(p,q)=yms(p,q)-round(yms(p,q),100);

            if 0<=mos(p,q)<=(12-nms(p,q)) then yme(p,q)=yms(p,q)+mos(p,q);

            do k=1 to 13;

               A=(k*88);

               if ((k*12)+1-nms(p,q))<=mos(p,q)<=((k*12)+12-nms(p,q)) then yme(p,q)=yms(p,q)+A+mos(p,q);

            end;

            if yme(p,q)>iym then yme(p,q)=iym;

         end;  

        

         * If end date is known (then estimated weeks is not asked and so wks=-4). Then set start date

           to Jan of start year;

         if yme(p,q)>0 and wks(p,q)=-4 then yms(p,q)=((ys(p,q)*100)+01); 

         if yms(p,q)<dliym then yms(p,q)=dliym;

         if yms(p,q)>((ys(p,q)*100)+12) then yms(p,q)=((ys(p,q)*100)+12);

        

      efl(p,q)=2;

     

      end;

 

 

      ** (3) If start year is unknown;

 

      if -3<=ys(p,q)<=-1 then do;

 

         * If estimated weeks are known then count back from DCI if currently receiving.;

         if wks(p,q)>=0 and cwks(p,q)=1 then do;

            yme(p,q)=iym;

            if 0<=mos(p,q)<=(intm-1) then yms(p,q)=iym-mos(p,q);

            do k=1 to 13;

               A=(k*88);

               if (intm+(k*12)-12)<=mos(p,q)<=(intm+(k*12)-1) then yms(p,q)=iym-A-mos(p,q);

            end;

            if yms(p,q)<dliym then yms(p,q)=dliym;

         end;

 

         * If estimated weeks missing and currently receiving then set start date to DLI and end date to

           DCI;

         if -3<=wks(p,q)<0 and cwks(p,q)=1 then do;

            yms(p,q)=dliym;

            yme(p,q)=iym;

         end;

 

         * If estimated weeks are known and not currently receiving then count backward from DCI or the

           stop date if known and set Jan of that year as the start year. Then add the estimated number

           of months receiving and get the stop date. Constrain stop date by DCI;

           

         if wks(p,q)>=0 and cwks(p,q)=0 and yme(p,q)<=0 then do;

            if 0<=mos(p,q)<=intm then do;

               yms(p,q)=(inty*100)+01;

               yme(p,q)=(inty*100)+01+mos(p,q);

            end;

            do k=1 to 13;

               if (intm+(k*12)-11)<=mos(p,q)<=(intm+(k*12)) then do;

                   yms(p,q)=((inty-k)*100)+01;

                   if 0<=mos(p,q)<=(k*12)     then yme(p,q)=((inty-1)*100)+01+mos(p,q)-(k*12)+12;

                   if    mos(p,q)>=((k*12)+1) then yme(p,q)= (inty*100)   +01+mos(p,q)-(k*12);

               end;

            end;

         end;

         else if wks(p,q)>=0 and cwks(p,q)=0 and yme(p,q)>0 then do;

            if 0<=mos(p,q)<=me(p,q) then do;

               yms(p,q)=(ye(p,q)*100)+01;

               yme(p,q)=(ye(p,q)*100)+01+mos(p,q);

            end;

            do k=1 to 13;

               if (me(p,q)+(k*12)-11)<=mos(p,q)<=(me(p,q)+(k*12)) then do;

                   yms(p,q)=((ye(p,q)-k)*100)+01;

                   if 0<=mos(p,q)<=(k*12)     then yme(p,q)=((ye(p,q)-1)*100)+01+mos(p,q)-(k*12)+12;

                   if    mos(p,q)>=((k*12)+1) then yme(p,q)= (ye(p,q)*100)   +01+mos(p,q)-(k*12);

               end;

            end;

            if yme(p,q)>iym then yme(p,q)=iym;

         end;

 

         efl(p,q)=3;

 

      end;

 

      * If stop date is known but start date is not, then set DLI as start date;

      if yme(p,q)>0 and yms(p,q)=. then do;

         yms(p,q)=dliym;

         if q=1 or q=((dim(csm,2)/2)+1) then efl(p,q)=3;

         else if 2<=q<=(dim(csm,2)/2) or ((dim(csm,2)/2)+2)<=q<=dim(csm,2) then efl(p,q)=7;

      end;

 

 

      ** (4) If stop year is known but stop month is not known;

 

      if yms(p,q)>0 and ye(p,q)>0 and -2<=me(p,q)<=-1 then do;

 

         * If estimated weeks are known, then count forward from start date. If the number of months

           falls short of the stop year, then use Jan of the end year as the stop date. If the number of

           months exceeds the stop year, then use Dec of the end year as the stop date. Constrain stop

           date by DCI;

         if wks(p,q)>=0 then do;

            nms(p,q)=yms(p,q)-round(yms(p,q),100);

            if 0<=mos(p,q)<=(12-nms(p,q)) then yme(p,q)=yms(p,q)+mos(p,q);

            do k=1 to 13;

               A=(k*88);

               if ((k*12)+1-nms(p,q))<=mos(p,q)<=((k*12)+12-nms(p,q)) then yme(p,q)=yms(p,q)+A+mos(p,q);

            end;

            if yme(p,q)>((ye(p,q)*100)+12) then yme(p,q)=((ye(p,q)*100)+12);

            if yme(p,q)<((ye(p,q)*100)+01) then yme(p,q)=((ye(p,q)*100)+01);

            if yme(p,q)>iym then yme(p,q)=iym;

         end;

 

         * If estimated weeks are missing then set end date to Dec of stop year and constrain by DCI;

         if -3<=wks(p,q)<0 then yme(p,q)=((ye(p,q)*100)+12);

         if yme(p,q)>iym then yme(p,q)=iym;

        

         if (efl(p,q) not in (2,3,7) or efl(p,q)=.) then efl(p,q)=4;

         if efl(p,q) in (2,3,7) then efl(p,q)=6;

 

      end;

 

 

      ** (5) If stop year is unknown;

 

      if -3<=ye(p,q)<=-1 then do;

 

         * If estimated weeks are known then count forward from start date;

         if yms(p,q)>0 and wks(p,q)>=0 then do;

            nms(p,q)=yms(p,q)-round(yms(p,q),100);

            if 0<=mos(p,q)<=(12-nms(p,q)) then yme(p,q)=yms(p,q)+mos(p,q);

            do k=1 to 13;

               A=(k*88);

               if ((k*12)+1-nms(p,q))<=mos(p,q)<=((k*12)+12-nms(p,q)) then yme(p,q)=yms(p,q)+A+mos(p,q);

            end;

            if yme(p,q)>iym then yme(p,q)=iym;

         end;

 

         * If estimated weeks are missing then set Dec of start year as stop date and constrain by DCI;

         if yms(p,q)>0 and -3<=wks(p,q)<0 then yme(p,q)=(round (yms(p,q),100))+12;

         if yme(p,q)>iym then yme(p,q)=iym;

 

         if (efl(p,q) not in (2,3,7) or efl(p,q)=.) then efl(p,q)=5;

         if efl(p,q) in (2,3,7) then efl(p,q)=6;

      end;

 

 

      ** (6) If the start and stop years are unknown and theestimated weeks are unknown, use DLI and DCI

             as start and stop dates, respectively.;

 

      if -3<=ys(p,q)<=-1 and -3<=ye(p,q)<=-1 and cwks(p,q)=0 and -3<=wks(p,q)<0 then do;

         yme(p,q)=iym;

         yms(p,q)=dliym;

 

         if q=1 or q=((dim(csm,2)/2)+1) then efl(p,q)=6;

         else if 2<=q<=(dim(csm,2)/2) or ((dim(csm,2)/2)+2)<=q<=dim(csm,2) then efl(p,q)=7;

      end;

 

 

      ** Convert start and stop dates of the program spells into cms format;

      csm(p,q)=(round(yms(p,q),100)-198000)*.12+(yms(p,q)-round(yms(p,q),100));

      cem(p,q)=(round(yme(p,q),100)-198000)*.12+(yme(p,q)-round(yme(p,q),100));

 

 

      *** Create a variable that determines which person in the household receives the

          particular spell of the particular program.;

      ***********************************************************************************

      **  Define the person in the household receiving the program variable.           **

      **  Collapse the answers into 8 categories.  The coding is the following -       **

      **  1=Respondent only                                                            **

      **  2=spouse/partner only                                                        **

      **  3=child only                                                                 **

      **  4=Resopndent and spouse/partner                                              **

      **  5=Respondent and child                                                       **

      **  6=spouse/partner and child                                                   **

      **  7=Respondent and spouse/partner and child                                    **

      **  8=other                                                                                                       **

      **  The first 7 categories may include an 'other' person as represented by the   **

      **  response categories 4 (other relatives in household) and 5 (other (specify)) **

      **  in the original question. Only cases where the only person/persons who are   **

      **  reported as receiving that the 8th category 'other' is coded.                **

      ***********************************************************************************;

 

      if rcvr(p,q)=1 and rcvs(p,q)=0 and rcvc(p,q)=0  then who(p,q)=01;

      if rcvr(p,q)=0 and rcvs(p,q)=1 and rcvc(p,q)=0  then who(p,q)=02;

      if rcvr(p,q)=0 and rcvs(p,q)=0 and rcvc(p,q)=1  then who(p,q)=03;

      if rcvr(p,q)=1 and rcvs(p,q)=1 and rcvc(p,q)=0  then who(p,q)=04;

      if rcvr(p,q)=1 and rcvs(p,q)=0 and rcvc(p,q)=1  then who(p,q)=05;

      if rcvr(p,q)=0 and rcvs(p,q)=1 and rcvc(p,q)=1  then who(p,q)=06;

      if rcvr(p,q)=1 and rcvs(p,q)=1 and rcvc(p,q)=1  then who(p,q)=07;

      if -3<=rcvr(p,q)<0 then who(p,q)=rcvr(p,q);

      if rcvr(p,q)=0 and rcvs(p,q)=0 and rcvc(p,q)=0 and (rcvf(p,q)=1 or rcvo(p,q)=1) then who(p,q)=08;

 

 

      *** Create a variable that calculates the amount that is received by the household each month

          during a particular spell of a particular program.;

      ************************************************************************************************

      ** Create an estimated amount using the category reported by Respondent. The estimated amount **

      ** is the midpoint rounded down. Note that the 12th category for AFDC, FST & OTH lists $1251  **

      ** as the amount. This amount was chosen since that category is unbounded - the number, 1251  **

      ** represents 1 dollar above the lower bound, $1250. Similarly the 6th (highest) category for **

      ** WIC is $101, $1 above the lower bound, $100.                                               **

      **********************************************************************************************;

 

      ** AFDC;

      if p=1 then do; 

         inc(p,q)=incm(p,q);

         if -3<=incm(p,q)<=-1 and 1<=eincm(p,q)<=10 then inc(p,q)=(eincm(p,q)*100)-50;

         if -3<=incm(p,q)<=-1 and eincm(p,q)=11 then inc(p,q)=1125;

         if -3<=incm(p,q)<=-1 and eincm(p,q)=12 then inc(p,q)=1251;

      end; 

 

      ** WIC;

      if p=2 then do;

         inc(p,q)=incm(p,q);       

         if -3<=incm(p,q)<=-1 and 1<=eincm(p,q)<=5 then inc(p,q)=(eincm(p,q)*20)-10;

         if -3<=incm(p,q)<=-1 and eincm(p,q)=6 then inc(p,q)=101;

      end;

            

      ** FST;

      if p=3 then do;

         inc(p,q)=incm(p,q);       

         if -3<=incm(p,q)<=-1 and 1<=eincm(p,q)<=10 then inc(p,q)=(eincm(p,q)*100)-50;

         if -3<=incm(p,q)<=-1 and eincm(p,q)=11 then inc(p,q)=1125;

         if -3<=incm(p,q)<=-1 and eincm(p,q)=12 then inc(p,q)=1251;

      end;

  

      ** OTH;

      if p=4 then do;

         inc(p,q)=incm(p,q);       

         if -3<=incm(p,q)<=-1 and 1<=eincm(p,q)<=10 then inc(p,q)=(eincm(p,q)*100)-50;

         if -3<=incm(p,q)<=-1 and eincm(p,q)=11 then inc(p,q)=1125;

         if -3<=incm(p,q)<=-1 and eincm(p,q)=12 then inc(p,q)=1251;

      end;

    

 

      if inc(p,q)>-4 then afl(p,q)=0;

  

      ** Compute edit flags for dates (efls) for those cases that could not be computed earlier and nefl

         was computed instead.;

      if efl(p,q)=. and nefl(p,q)~=. then efl(p,q)=nefl(p,q);

     

   end;                                                                                                           /** [E2] **/

end;                                                                                                  /** [E1] **/ 

 

do p=1 to 4;

   do q=1 to dim(csm,2);

      tcsm(p,q)=csm(p,q); tcem(p,q)=cem(p,q);

      twho(p,q)=who(p,q); tinc(p,q)=inc(p,q);

      tefl(p,q)=efl(p,q); tafl(p,q)=afl(p,q);

   end;

end;   

 

*** Handedits (1);

** Respondent reports receiving, but doesn't know whether stopped for more than a month and so we do not

   have any information on stop date. We then handedit these cases on a case-by-case basis.;

do p=1 to 4;

   do q=1 to dim(csm,2);

      if -3<=stpgp(p,q)<=-1 then do;

         HE=HE+1; dtps1=1; dtp1(p)=1;

      end;

      if -3<=cur(p,q)<=-1 or -3<=cwks(p,q)<=-1 then do;

         HE=HE+1; dtps1=2; dtp1(p)=2;

      end;

   end;

end;

 

* WIC: dli=1, curr_rec=0, stpgp=-2 & comments indicate Respondent did not receive. We make the stop date

       to be DLI so that the program will compute as never having received in this round.;

  if PUBID=884 then do;

     cemw11=cdli;

  end;  

* WIC: dli=1, curr rec=0, amt & est amt=-2, stpgp=-2, who=Respondent & Child. Perhaps stopped during

       month or just before the month of current interview. So, we take the stop date to be the month

       before DCI.;

  if PUBID=8431 then do;

     cemw11=doicm-1;  

     eflw11=5;

  end;  

* FST: dli=1, curr_rec=0, stpgp=-2, who=Respondent & child, est. amt.>0. Perhaps stopped during month

       or just before the month of current interview. So, we take the stop date to be the month before

       DCI.;

  if PUBID=7159 then do;

     cemf11=doicm-1;

     eflf11=5;

  end;

 

* WIC: dli=1, curr_rec=1, 1st spell: stpgp=-2, who=Child, inc=est. 2nd spell: csm=Feb 03 (which is DLI),

       stpgp=0, who=Child, inc=est & diff from 1st spell. Leave it as it is. (PUBID=8484);

* FST: dli=1, curr_rec=1, 2 spells, who=R,Sp,Ch, Other for both spells. All other info. are DK.

  Leave it as it is. (PUBID=2747);

 

* FST: All info. other than who is DK. Since who is other family membe/relative etc. it is quite possible

       that Respondent does not know any of this. So, we create a spell from DLI to DCI and put efl=9,

       who=-3 & inc=-3;

if PUBID=8272 then do;

   csmf21=dlicm;

   cemf21=doicm;

   eflf21=9;

   incf21=-3;

   aflf21=-3;

   whof21=-3;

end;

 

** When Respondents report overlapping spells with amount receiving and person receiving are the same

   for these spells we just merge all the consecutive spells into 1.;

do p=1 to 4;

   do q=4,3,2,8,7,6;

      if 0<tcsm(p,q)<=tcem(p,q-1) & tefl(p,q)=1 & tefl(p,q-1)=1

      & ((tinc(p,q)=tinc(p,q-1) & tinc(p,q)>=0)|(tinc(p,q)<0 & tinc(p,q-1)<0))

      & ((twho(p,q)=twho(p,q-1) & twho(p,q)>=0)|(twho(p,q)<0 & twho(p,q-1)<0))

      then do;

         HE=HE+1;

         dtps2=1;

         dtp2(p,q)=1; dtp2(p,q-1)=1;

         csm(p,q)=tcsm(p,q); cem(p,q)=tcem(p,q);

         who(p,q)=twho(p,q); inc(p,q)=tinc(p,q);

         efl(p,q)=tefl(p,q); afl(p,q)=tafl(p,q);

         if 0<tcsm(p,q)<tcsm(p,q-1) then csm(p,q-1)=tcsm(p,q);

         if 0<tcem(p,q-1)<tcem(p,q) then cem(p,q-1)=tcem(p,q);

         csm(p,q)=.;

         cem(p,q)=.;

         inc(p,q)=.;

         who(p,q)=.;

         efl(p,q)=.;

         afl(p,q)=.;

      end;

   end;

end;

 

** When Respondents report overlapping spells being received by different persons it means these are two

   different legitimate spells and so should be counted separately. Our program will however overwrite

   the earlier spell amount by the latter spell amount for the overlapping months. To correct for that

   we have to handedit.;

do p=1 to 4;

   do q=2 to (dim(csm,2)/2);

      if 0<csm(p,q)<=cem(p,q-1) & efl(p,q)=1 & efl(p,q-1)=1 & who(p,q)~=who(p,q-1) then do;

         HE=HE+1;

         prgerr=1;

         whodf(p)=1;

      end;

   end;

   do q=(dim(csm,2)/2)+2 to dim(csm,2);

      if 0<csm(p,q)<=cem(p,q-1) & efl(p,q)=1 & efl(p,q-1)=1 & who(p,q)~=who(p,q-1) then do;

         HE=HE+1;

         prgerr=1;

         whodf(p)=2;

      end;

   end;

end;

 

 

** When Respondents report overlapping spells with amount receiving different and same person receiving

   for these spells we put -3 for all the monthly variables as we cannot decide which of the two values

   to put and when one spell ended and the other started. Identify these cases and then handedit them.

   Initially put the monthly received variables to 9 (that is necessary for the program to work) and

   then later change these to -3.;

do p=1 to 4;

   do q=4,3,2,8,7,6;

      if 0<tcsm(p,q)<=tcem(p,q-1) & tefl(p,q)=1 & tefl(p,q-1)=1 & twho(p,q)=twho(p,q-1)

      & ((tinc(p,q)~=tinc(p,q-1) & tinc(p,q)>=0)|(tinc(p,q)>=0 & tinc(p,q-1)<0)|(tinc(p,q)<0 & tinc(p,q-1)>=0))

      then do;

         HE=HE+1;

         dtps3=1;

         dtp3(p,q)=1; dtp3(p,q-1)=1;

         csm(p,q)=tcsm(p,q); cem(p,q)=tcem(p,q);

         who(p,q)=twho(p,q); inc(p,q)=tinc(p,q);

         efl(p,q)=tefl(p,q); afl(p,q)=tafl(p,q);

         if 0<tcsm(p,q-1)<tcsm(p,q) then csm(p,q)=tcsm(p,q-1);

         if 0<tcem(p,q)<tcem(p,q-1) then cem(p,q)=tcem(p,q-1);

         efl(p,q)=9;

         inc(p,q)=-3;

         afl(p,q)=-3;

         who(p,q)=-3;

         csm(p,q-1)=.;

         cem(p,q-1)=.;

         efl(p,q-1)=.;

         inc(p,q-1)=.;

         afl(p,q-1)=.;

         who(p,q-1)=.;

      end;

   end;

end;

 

 

** Respondents report receiving, currently not receiving and no periods of 1 month or more when they did

   not receive. So we take this to be receiving till less than a month before the interview.;

do p=1 to 4;

   do q=1 to dim(csm,2);

      if (cur(p,q)=0|cwks(p,q)=0) & stpgp(p,q)=0 then do;

         HE=HE+1;

         dtps4=1;

         if dtp4(p)~=-1 then dtp4(p)=1;

         if efl(p,q)>1 then dtp4(p)=-1;

         cem(p,q)=doicm-1;

         efl(p,q)=1;

       end;

   end;

end;

 

** Respondents report currently receiving, a period of 1 month or more when they did not receive, have a

   valid stop date but when asked if they received again, said NO so did not go through the second loop.

   We create another loop from the month after the reported stop month to DCI, and put efl=7, inc=-3

   and who=-3. IF THE STOP DATE IS DCI, THEN WE DO NOT HANDEDIT.;

do p=1 to 4;

 

   do q=1 to dim(csm,2)-1;

      if q~=dim(csm,2)/2 & (cur(p,q)=1|cwks(p,q)=1) & stpgp(p,q)=1 & ye(p,q)>0 & me(p,q)>0 & recag(p,q)=0

      & cem(p,q)~=doicm then do;

         HE=HE+1;

         dtps5=1;

         if dtp5(p)~=-1 then dtp5(p)=1;

         if efl(p,q)>1 then dtp5(p)=-1;

         csm(p,q+1)=tcem(p,q)+1;

         cem(p,q+1)=doicm;

         efl(p,q+1)=7;

         afl(p,q+1)=-3;

         inc(p,q+1)=-3;

         who(p,q+1)=-3;

      end;

   end;

   do q=dim(csm,2), dim(csm,2)/2; * Identify these cases and then add another spell.;

      if (cur(p,q)=1|cwks(p,q)=1) & stpgp(p,q)=1 & ye(p,q)>0 & me(p,q)>0 & recag(p,q)=0

      & cem(p,q)~=doicm then do;

         HE=HE+1;

         dtps5=1;

         if dtp5(p)~=-2 then dtp5(p)=2;

         if efl(p,q)>1 then dtp5(p)=-2;

      end;

   end;

 

end;

 

 

** If Respondent reports a valid stop date but is not asked whether receives again then handedit in a

   way similar to cases of dtps5. As in dtps5 cases we do not handedit if stop date reported is DCI.;

do p=1 to 4;

   do q=1 to dim(csm,2)-1;

      if q~=dim(csm,2)/2 & ((ys(p,q)>0 & ms(p,q)>0)|dli(p,q)=1) & ye(p,q)>0 & me(p,q)>0 & recag(p,q)=-4

      & cem(p,q)~=doicm then do;

         HE=HE+1;

         dtps6=1;

         if dtp6(p)~=-1 then dtp6(p)=1;

         if efl(p,q)>1 then dtp6(p)=-1;

         csm(p,q+1)=tcem(p,q)+1;

         cem(p,q+1)=doicm;

         efl(p,q+1)=7;

         inc(p,q+1)=-3;

         afl(p,q+1)=0;

         who(p,q+1)=-3;

      end;

   end;

   do q=dim(csm,2),dim(csm,2)/2; * Identify these cases and then add another spell.;

      if ((ys(p,q)>0 & ms(p,q)>0)|dli(p,q)=1) & (ye(p,q)>0 & me(p,q)>0) & recag(p,q)=-4

      & cem(p,q)~=doicm then do;

         HE=HE+1;

         dtps6=1;

         if dtp6(p)~=-2 then dtp6(p)=2;

         if efl(p,q)>1 then dtp6(p)=-2;

      end;

   end;

end;

 

** Respondents went through the NVPR section even though they had reported receiving that program in

   earlier rounds. In a later section (dtps7) we will anyway take care of not counting the months before

   DLI.;

do p=1 to 4;

   do q=(dim(csm,2)/2)+1 to dim(csm,2);

      if inc(p,q)>-4 and ocsm(p)~=. then do;

         HE=HE+1;

         dtps7=1;

         if dtp7(p)~=-1 then dtp7(p)=1;

         if efl(p,q)>1 then dtp7(p)=-1;

      end;

   end;

end;

 

 

*** Create the monthly array variables - those that indicate whether Respondent received any of the four

    government programs in a particular month and the monthly amount received from all these programs.;

c=0;

do l=1 to doicm;                                                                            /** [B3] **/

   c=c+1;

   do q=1 to dim(csm,2);                                                                    /** [B4] **/

     

      

      ** AFDC;

      if 0<csm(1,q)<=c<=cem(1,q) then do;

         AREC(l)=efl(1,q);

         AHHM(l)=who(1,q);

         AAMT(l)=inc(1,q);

         aod=0;

         if AAMT(l)>1000 then aod=AAMT(l);

         if AREC(l)>0 and (AAMT(l)=. or AHHM(l)=.) then do;

            ackr=ackr+1;

         end;

         if (AAMT(l)>0 or -3<=AAMT(l)<0) and (AREC(l)=0 or AHHM(l)=.) then do;

            acka=acka+1;

         end;

         if AHHM(l)>0 and (AREC(l)=0 or AAMT(l)=.) then do;

            ackh=ackh+1;

         end;

         if AREC(l)=-3 and (AHHM(l)~=-3 or AAMT(l)~=-3) then do;

            ackv=ackv+1;

         end;

         if AAMT(l)=0 then dummya=1;

      end;

     

     

      ** WIC;

      if 0<csm(2,q)<=c<=cem(2,q) then do;

         WREC(l)=efl(2,q);

         WHHM(l)=who(2,q);

         WAMT(l)=inc(2,q);

         wod=0;

         if WAMT(l)>1000 then wod=WAMT(l);

         if WREC(l)>0 and (WAMT(l)=. or WHHM(l)=.) then do;

            wckr=wckr+1;

         end;

         if (WAMT(l)>0 or -3<=WAMT(l)<0) and (WREC(l)=0 or WHHM(l)=.) then do;

            wcka=wcka+1;

         end;

         if WHHM(l)>0 and (WREC(l)=0 or WAMT(l)=.) then do;

            wckh=wckh+1;

         end;

         if WREC(l)=-3 and (WHHM(l)~=-3 or WAMT(l)~=-3) then do;

            wckv=wckv+1;

         end;

         if WAMT(l)=0 then dummyw=1;

      end;

     

     

      ** FST;

      if 0<csm(3,q)<=c<=cem(3,q) then do;

         FREC(l)=efl(3,q);

         FHHM(l)=who(3,q);

         FAMT(l)=inc(3,q);

         fod=0;

         if FAMT(l)>1000 then fod=FAMT(l);

         if FREC(l)>0 and (FAMT(l)=. or FHHM(l)=.) then do;

            fckr=fckr+1;

         end;

         if (FAMT(l)>0 or -3<=FAMT(l)<0) and (FREC(l)=0 or FHHM(l)=.) then do;

            fcka=fcka+1;

         end;

         if FHHM(l)>0 and (FREC(l)=0 or FAMT(l)=.) then do;

            fckh=fckh+1;

         end;

         if FREC(l)=-3 and (FHHM(l)~=-3 or FAMT(l)~=-3) then do;

            fckv=fckv+1;

         end;

         * This fixes a problem in round 3;

         if FHHM(l)=. and FREC(l)>0 and FAMT(l)~=. then do;

            FHHM(l)=-3;

            fckneg=1;

         end;

         if FAMT(l)=0 then dummyf=1;

      end;

     

     

      ** OTH;

      if 0<csm(4,q)<=c<=cem(4,q) then do;

         OREC(l)=efl(4,q);

         OHHM(l)=who(4,q);

         OAMT(l)=inc(4,q);

         ood=0;

         if OAMT(l)>1000 then ood=OAMT(l);

         if OREC(l)>0 and (OAMT(l)=. or OHHM(l)=.) then do;

            ockr=ockr+1;

         end;

         if (OAMT(l)>0 or -3<=OAMT(l)<0) and (OREC(l)=0 or OHHM(l)=.) then do;

            ocka=ocka+1;

         end;

         if OHHM(l)>0 and (OREC(l)=0 or OAMT(l)=.) then do;

            ockh=ockh+1;

         end;

         if OREC(l)=-3 and (OHHM(l)~=-3 or OAMT(l)~=-3) then do;

            ockv=ockv+1;

         end;

         if OAMT(l)=0 then dummyo=1;

      end;

 

 

   end;                                                                                     /** [E4] **/

end;                                                                                        /** [E3] **/

 

 

*** Handedits (2);

 

** Respondent reported receiving in months prior to DLI. We delete any information in the monthly

   variables till DLI i.e receiving variables are 0, amount and person receiving variables are missing.;

do p=1 to 4;

   do q=1 to dim(csm,2);

      if 0<csm(p,q)<=cdli then do;

         HE=HE+1;

         dtps8=1;

         if dtp8(p)~=-1 then dtp8(p)=1;

         if efl(p,q)>1 then dtp8(p)=-1;

         C=0;

         do l=1 to dim(AREC);

            C=C+1;

            if csm(p,q)<=C<=cdli then do;

               ALLREC(p,l)=0;

               ALLAMT(p,l)=.;

               ALLHHM(p,l)=.;

            end;

         end;

      end;

   end;

end;

 

 

if GPEV>-4 then do;

   *** Adjust amount variables if they appear to be too high - then we assume that Respondents have

       reported the whole amount that they received instead of the average monthly amount.;

 

   ** Compute aodttl, wodttl, fodttl and oodttl.;

   do l=1 to dim(AREC);

      if AREC(l)>0 and AAMT(l)>1000 and aod>0 then do;

         aodttl=aodttl+1;

      end;

      if FREC(l)>0 and FAMT(l)>1000 and fod>0 then do;

         fodttl=fodttl+1;

      end;

      if OREC(l)>0 and OAMT(l)>1000 and ood>0 then do;

         oodttl=oodttl+1;

      end;

      if WREC(l)>0 and WAMT(l)>1000 and wod>0 then do;

         wodttl=wodttl+1;

      end;

   end;

 

 

   ** Divide the abnormally high amount by the total number of months receiving these amounts.;

   do l=1 to dim(AREC);

      if AAMT(l)>1000 and aodttl>0 and AREC(l)>0 then do;

         AAMT(l)=round(AAMT(l)/aodttl, 1);

      end;

      if WAMT(l)>1000 and wodttl>0 and WREC(l)>0 then do;                        

         WAMT(l)=round(WAMT(l)/wodttl, 1);

      end;

      if FAMT(l)>1000 and fodttl>0 and FREC(l)>0 then do;                             

         FAMT(l)=round(FAMT(l)/fodttl, 1);

      end;

      if OAMT(l)>1000 and oodttl>0 and OREC(l)>0 then do;                          

         OAMT(l)=round(OAMT(l)/oodttl, 1);

      end;

   end;

 

 

   *** Compute mxx, amtxx and ttlg - months receiving in each year (mxx), the amount receiving in each

       year (amtxx) and the total number of months received ever (ttlg) - all based on information from

       the current round;

   do j=1 to dim(GPRTTL);

      gm(j)=0;

      ttlg=0;

      gamt(j)=0;

      ga(j)=0;

      gn(j)=0;

   end;

   do j=1 to dim(GPRTTL);

      do l=((j*12)-11) to (j*12);

         if gm(j)>=0 and (AREC(l)>0 or WREC(l)>0 or FREC(l)>0 or OREC(l)>0) then do;

            gm(j)=gm(j)+1;

         end;

         if AREC(l)>1 then gm(j)=-3;

         if WREC(l)>1 then gm(j)=-3;

         if FREC(l)>1 then gm(j)=-3;

         if OREC(l)>1 then gm(j)=-3;

         do p=1 to 4;

            if -3<=ALLAMT(p,l)<=-1 then do;

               gn(j)=gn(j)+1;

               gamt(j)=ALLAMT(p,l);

            end;

            if ALLAMT(p,l)>=0 then do;

               ga(j)=ga(j)+1;

               if ga(j)=1 and gn(j)=0 then gamt(j)=ALLAMT(p,l);

               if ga(j)>1 and gn(j)=0 then gamt(j)=gamt(j)+ALLAMT(p,l);

               if gm(j)=-3 then gamt(j)=-3;

            end;

         end;

      end;

   end;

   do l=1 to dim(AREC);

      if ttlg>=0 and (AREC(l)=1 or WREC(l)=1 or FREC(l)=1 or OREC(l)=1) then do;

         ttlg=ttlg+1;

      end;

      if AREC(l)>1 or AREC(l)=-3 then ttlg=-3;

      if WREC(l)>1 or WREC(l)=-3 then ttlg=-3;

      if FREC(l)>1 or FREC(l)=-3 then ttlg=-3;

      if OREC(l)>1 or OREC(l)=-3 then ttlg=-3;

   end;

 

end;

 

*** Handedits (3);

** Reconverting monthly receiving variables from 9 to -3.;

do p=1 to 4;

   do l=1 to dim(AREC);

      if ALLREC(p,l)=9 then ALLREC(p,l)=-3;

   end;

end;

 

** We put back the original start and stop dates, edit flags for dates and amounts of overlapping spells

   which we had changed for computing purposes (see dtps2 and dtps3).;

do p=1 to 4;

   do q=1 to dim(csm,2);

      if (dtp2(p,q)=1|dtp3(p,q)=1) then do;

         csm(p,q)=tcsm(p,q);

         cem(p,q)=tcem(p,q);

         inc(p,q)=tinc(p,q);

         who(p,q)=twho(p,q);

         efl(p,q)=tefl(p,q);

         afl(p,q)=tafl(p,q);

      end;

   end;

end;

     

** Adding the amounts received by the second person in the overlapping spell - follow-up from prgerr in

   Handedit1 section.;

if PUBID=4678 then do;

   wamt287=wamt287+100;

   whhm287=5;

end;

if PUBID=5856 then do;

   wamt281=wamt281+40; wamt282=wamt282+40; wamt283=wamt283+40; wamt284=wamt284+40;

   whhm281=4; whhm282=4; whhm283=4; whhm284=4;

end;

if PUBID=6360 then do;

   wamt287=wamt287+200;

   whhm287=6;

end;

if PUBID=7091 then do;

   wamt287=wamt287+101;

   whhm287=5;

end;

if PUBID=7349 then do;

   wamt287=wamt287+150;

   whhm287=7;

end;

if PUBID=8735 then do;

   oamt280=oamt280+628; oamt281=oamt281+628; oamt282=oamt282+628; oamt283=oamt283+628;

   oamt284=oamt284+628; oamt285=oamt285+628; oamt286=oamt286+628; oamt287=oamt287+628;

   do l=280 to 287;

      ohhm(l)=5;

   end;

end;

if PUBID=3058 then do;

   orec283=-3;

   orec284=-3;

   orec285=-3;

   csmo13=286;

end;

 

 

*********************************************** PART IV ************************************************

** Create the final variables by combining information from this and earlier rounds.                  **

 

*** Calculate the total number of months ever received (GPEV).;

if ttlg>=0 and GPEV>=0 then GPEV=ttlg+GPEV;

if ttlg in (-1,-2,-3) or GPEV in (-1,-2-3) then GPEV=-3;

 

 

*** Calculate the total number of months received in each year (GIRTTLXX) and the total amount

   receiving in each year (GPATTLXX).;

do j=1 to dim(GPRTTL);

   if gm(j)>=0 and GPRTTL(j)>=0 then do;                              

      GPRTTL(j)=gm(j)+GPRTTL(j);

   end;

   if gm(j)<0 or GPRTTL(j)<0 then GPRTTL(j)=-3;

   if gamt(j)>=0 and GPATTL(j)>=0 then do;

      GPATTL(j)=gamt(j)+GPATTL(j);

   end;

   if gamt(j)<0 or GPATTL(j)<0 or (GPRTTL(j)<0 and GPRTTL(j)~=-4) then GPATTL(j)=-3;

   if gamt(j)=0 and ogpattl(j)=-4 and GPRTTL(j)=0 then GPATTL(j)=-4;

end;

 

 

*** To change all invalid skips to -3;

 

array vars GPEV GPRTTL80-GPRTTL99 GPRTTL00 GPRTTL01-GPRTTL04

                GPATTL80-GPATTL99 GPATTL00 GPATTL01-GPATTL04;

 

do over vars;

   if vars=-2 then vars=-3;

   if vars=-1 then vars=-3;

end;

 

*** Handedits (4):

* FST: dli=0, csm=Feb 02, curr rec=1, stpgp=-2, who=Sp, est amt<0. The program computes one spell from

  Feb 2002 to current interview date. But we do not know the start and stop dates of the gap which

  Respondent says he/she does not know. So we change all the created variables over the relevant period

  to be -3.;

if PUBID=8921 then do;

   gpev=-3;

   gprgttl02=-3;

   gprgttl03=-3;

   gpattl02=-3;

   gpattl03=-3;

end;

* WIC: dli=1, all info. is -2, including person receiving. We leave it as it is. The program does not

  compute the stop date and so no spells are computed. But the problem is the person did start receiving

  from DLI we just do not know when Respondent stopped receiving. So we change all the created variables

  over the relevant period to be -3.;

if PUBID=3104 then do;

   gpev=-3;

   gprttl00=-3;

   gprttl01=-3;

   gprttl02=-3;

   gprttl03=-3;

   gpattl00=-3;

   gpattl01=-3;

   gpattl02=-3;

   gpattl03=-3;

end;

 

ENDSAS;

Return to top


Unemployment Compensation

Variables Created:

Variables Used

This program creates several variables describing the respondent's receipt of unemployment compensation:

  1. CV_UI_YR.XX - indicates the number of months in any given year (from 1980 to 2004) that R received Unemployment Compensation.
  2. CV_UI_EVER - indicates the total number of months (from 1980 to 2004) that R received Unemployment Compensation.
  3. CV_AMT_UI_YR.XX - indicates the amount of Unemployment Compensation received in any given year (from 1980 to 2004) by R.
  4. CV_UI_SPELLS_YR.XX - indicates the number of spells of Unemployment Compensation that R received started in any given year (from 1980 to 2004).

The program first creates a month-by-month participation array for unemployment compensation.  These month-by-month variables constitute part of the event history array for program participation; see appendix 7 for more information.  After the array is created, the program merges data to create the summary variables. 


** Initialize check variables;

handedit=0;

array dataprb (*) dataprb1-dataprb7;

do i=1 to dim(dataprb);

   dataprb(i)=0;

end;

 

 

** Note: Abbreviations used in this program are as follows:

   DLI    - Date of last interview

   DCI    - Date of current interview

   SDLI   - Since date of last interview

   NVPR   - Never prior - NVPR

   CMS    - Continuous month scheme (dates are counted as months from January 1, 1980)

   UNEMP  - Unemployment Compensation.

   YYYYMM - 4-digit year followed by 2-digit month;

 

*** All the arrays used in this program.;

 

** (1) Created variables (yearly) for current round.;

array UIRTTL  (25) UIRTTL80-UIRTTL99   UIRTTL00  UIRTTL01-UIRTTL04;

array UIATTL  (25) UIATTL80-UIATTL99   UIATTL00  UIATTL01-UIATTL04;

array UISPLS  (25) UISPLS80-UISPLS99   UISPLS00  UISPLS01-UISPLS04;

 

** (2) Interview dates of prior rounds.;

array intdR (6) intdR1-intdR6; * interview day.;

array intmR (6) intmR1-intmR6; * interview month.;

array intyR (6) intyR1-intyR6; * interview year.;

 

 

** (3) Created variables of prior rounds.;

array uievR   (6)    uievR1-uievR6; * no. of months ever received.;

* no. of months received in a given year.;

array uirttlR (6,25) uir1ttl80-uir1ttl99 uir1ttl00 uir1ttl01-uir1ttl04

                     uir2ttl80-uir2ttl99 uir2ttl00 uir2ttl01-uir2ttl04

                     uir3ttl80-uir3ttl99 uir3ttl00 uir3ttl01-uir3ttl04

                     uir4ttl80-uir4ttl99 uir4ttl00 uir4ttl01-uir4ttl04

                     uir5ttl80-uir5ttl99 uir5ttl00 uir5ttl01-uir5ttl04

                     uir6ttl80-uir6ttl99 uir6ttl00 uir6ttl01-uir6ttl04;

* amount received in a given year.;

array uiattlR (6,25) uia1ttl80-uia1ttl99 uia1ttl00 uia1ttl01-uia1ttl04

                     uia2ttl80-uia2ttl99 uia2ttl00 uia2ttl01-uia2ttl04

                     uia3ttl80-uia3ttl99 uia3ttl00 uia3ttl01-uia3ttl04

                     uia4ttl80-uia4ttl99 uia4ttl00 uia4ttl01-uia4ttl04

                     uia5ttl80-uia5ttl99 uia5ttl00 uia5ttl01-uia5ttl04

                     uia6ttl80-uia6ttl99 uia6ttl00 uia6ttl01-uia6ttl04;

* no. of spells started in a given year.;

array uisplsR (6,25) ui1spls80-ui1spls99 ui1spls00 ui1spls01-ui1spls04

                     ui2spls80-ui2spls99 ui2spls00 ui2spls01-ui2spls04

                     ui3spls80-ui3spls99 ui3spls00 ui3spls01-ui3spls04

                     ui4spls80-ui4spls99 ui4spls00 ui4spls01-ui4spls04

                     ui5spls80-ui5spls99 ui5spls00 ui5spls01-ui5spls04

                     ui6spls80-ui6spls99 ui6spls00 ui6spls01-ui6spls04;

* start date of each spell.;

array csmR (6,4)     csmuR1_1-csmuR1_4

                     csmuR2_1-csmuR2_4

                     csmuR3_1-csmuR3_4

                     csmuR4_1-csmuR4_4

                     csmuR5_1-csmuR5_4

                     csmuR6_1-csmuR6_4;

* start date of each spell.;

array cemR (6,4)     cemuR1_1-cemuR1_4

                     cemuR2_1-cemuR2_4

                     cemuR3_1-cemuR3_4

                     cemuR4_1-cemuR4_4

                     cemuR5_1-cemuR5_4

                     cemuR6_1-cemuR6_4;

* edit flag for dates for each spell.;

array eflR (6,4)     efluR1_1-efluR1_4

                     efluR2_1-efluR2_4

                     efluR3_1-efluR3_4

                     efluR4_1-efluR4_4

                     efluR5_1-efluR5_4

                     efluR6_1-efluR6_4;

 

** (4) Most recent created variables available from prior rounds.;

* ouiev;                                                              * no. of months ever received.;

array ouirttl (25) ouirttl80-ouirttl99 ouirttl00 ouirttl01-ouirttl04; * no. of months rec., yearly;

array ouiattl (25) ouiattl80-ouiattl99 ouiattl00 ouiattl01-ouiattl04; * amount recd., yearly;

array ouispls (25) ouispls80-ouispls99 ouispls00 ouispls01-ouispls04; * no. of spells started, yearly.;

 

 

** (5) (Raw data) Information available from current round.;

 

* START YEAR, MONTH, ACTUAL DAY and ESTIMATED DAY.;

array ys    (8) ps4000Y1-ps4000Y4 p4000Y1-p4000Y4;

array ms    (8) ps4000M1-ps4000M4 p4000M1-p4000M4;

array ds    (8) ps42001-ps42004   p42001-p42004;

array es    (8) ps43001-ps43004   p43001-p43004;

 

* END YEAR, MONTH, ACTUAL DAY and ESTIMATED DAY.;

array ye    (8) ps4700Y1-ps4700Y4 p4700Y1-p4700Y4;

array me    (8) ps4700M1-ps4700M4 p4700M1-p4700M4;

array de    (8) ps49001- ps49004  p49001-p49004;

array ee    (8) ps50001- ps50004  p50001-p50004;

 

* ESTIMATED WEEKS - unable to answer start or stop date questions.;

array wks   (8) ps52001-ps52004   p52001-p52004;

 

* CURRENTLY RECEIVING:

  For NVPR sections: Since Respondents are routed through different branches some are asked the

                     currently receiving information in PS1897 and others in p3500. The information from

                     ps1897 and p3500 are combined into p3500 later in the program.;

array cur   (8) ps44001-ps44004             p44001-p44004;

array cwks  (8) ps1930 ps1930 ps1930 ps1930 p3500 p3500 p3500 p3500;

 

* RECEIVING at DLI:

                   Using ps3901 instead of ps1850 as the latter is asked of some Respondents only.;

array dli   (8) ps3901  dumu2-dumu8;

 

* AMOUNT RECEIVED - actual & estimated.;

array incm  (8) ps59001-ps59004  p59001-p59004;

array eincm (8) ps60001-ps60004  p60001-p60004;

 

* STOPPED FOR 2+ WEEKS.;

array stpgp (8) ps45001-ps45004  p45001-p45004;

 

* RECEIVE AGAIN (after stopping for 2+ weeks)?;

array recag (8) ps63001-ps63004  p63001-p63004;

 

 

** (6) Intermediate variables created based on information available from current round.;

 

array UIREC (300)  UIREC001-UIREC300; * indicator for receipt, monthly.;

array UIAMT (300)  UIAMT001-UIAMT300; * amount received, monthly.;

 

* ttlu;                                                         * no. of months ever received.;

array um      (25) um80-um99           um00      um01-um04;     * no. of months received, yearly.;

array uamt    (25) uamt80-uamt99       uamt00    uamt01-uamt04; * amount received, yearly.;

array nu      (25) nu80-nu99           nu00      nu01-nu04;     * no. of spells started, yearly.;

array ua      (25) ua80-ua99           ua00      ua01-ua04;     * no. of months with valid amounts.;

array un      (25) un80-un99           un00      un01-un04;     * no. of months with invalid amounts.;

 

array yms  (8) ymsu11-ymsu14 ymsu21-ymsu24;     * start date in YYYYMM scheme.;

array csm  (8) csmu11-csmu14 csmu21-csmu24;     * start date in CMS.;

array yme  (8) ymeu11-ymeu14 ymeu21-ymeu24;     * stop date in YYYYMM scheme.;

array cem  (8) cemu11-cemu14 cemu21-cemu24;     * stop date in CMS.;

array sdy  (8) sdyu11-sdyu14 sdyu21-sdyu24;     * start day.;

array edy  (8) edyu11-edyu14 edyu21-edyu24;     * stop day.;

array mos  (8) mosu11-mosu14 mosu21-mosu24;     * estimated months received.;

array nms  (8) nmsu11-nmsu14 nmsu21-nmsu24;     * start month.;

array inc  (8) incu11-incu14 incu21-incu24;     * daily amount.;

array afl  (8) aflu11-aflu14 aflu21-aflu24;     * amount flag.;

array efl  (8) eflu11-eflu14 eflu21-eflu24;     * date flag.;

array nefl (8) neflu11-neflu14 neflu21-neflu24; * date flag when efl is not computed bcos cem<dlicm;

array agfl (8) agflu11-agflu14 agflu21-agflu24; * age flag.;

array eflC (8) eflCu11-eflCu14 eflCu21-eflCu24; * date flag to be used for checking "efl";

array edli (8) edliu11-edliu14 edliu21-edliu24; * flag for stop date before DLI.;

array ovp  (8) ovpu11-ovpu14 ovpu21-ovpu24;     * Used for checking for overlapping spells.;

array mon  (12) mon1-mon12;                     * Month no.;

array ndy  (12) ndy1-ndy12;                     * No. of days in the corresponding month.;

array prbefl (7) prbefl1-prbefl7;               * To be used for checking efls.;

 

 

**** Handedits (1): from comments;

** R did not receive unemp comp but was erroneously reported as have done so.;

if PUBID in (3384 202) then do;

   do p=1 to dim(csm)/2;

      ys(p)=-4; ms(p)=-4; ye(p)=-4; me(p)=-4; wks(p)=-4; cur(p)=-4; cwks(p)=-4;

      incm(p)=-4; eincm(p)=-4; recag(p)=-4;

   end;

end;

 

 

********************************************************************************************************

** Initialize the created variables at the value at DLI. Create date of birth, DCI, DLI etc. in CMS  and YYYYMM schemes. **

 

** Identify the most recent round that R was interviewed prior to the current round (dli_rnd);

do i=1 to dim(intmR);

   if intmR(i)~=-5 then dli_rnd=i;

end;

 

** Intialize values of UIRTTL (& ouirttl), UIATTL (& ouiattl), UISPLS (& ouispls), UIEV (& ouiev),

   ocsmu, ocemu and oeflu by their values at the DLI;

do i=1 to dim(intmR);

   if dli_rnd=i then do;

      UIEV=uievR(i);

      ouiev=uievR(i);

      do j=1 to dim(UIRTTL);

         UIRTTL(j)=uirttlR(i,j);

         UIATTL(j)=uiattlR(i,j);

         UISPLS(j)=uisplsR(i,j);

         ouirttl(j)=UIRTTL(j);

         ouiattl(j)=UIATTL(j);

         ouispls(j)=UISPLS(j);

      end;

   end;

end;

 

** Identify the start and stop dates and edit flag for the last spell reported in prior rounds

   - ocsmu, ocemu and oeflu.;

do i=1 to dim(csmR,1);

   do t=1 to dim(csmR,2);

      if csmR(i,t)>-4 then do;

         ocsmu=csmR(i,t);

         ocemu=cemR(i,t);

         oeflu=eflR(i,t);

      end;

   end;

end;

 

 

** Change missing values and valid skips to zero to facilitate computation of created variables later in

   the program;

do j=1 to dim(UIRTTL);

   if UIRTTL(j)=. or UIRTTL(j)=-4 then do;

      ouirttl(j)=-4;

      UIRTTL(j)=0;

   end;

   if UIATTL(j)=. or UIATTL(j)=-4 then do;

      ouiattl(j)=-4;

      UIATTL(j)=0;

   end;

   if UISPLS(j)=. or UISPLS(j)=-4 then do;

      ouispls(j)=-4;

      UISPLS(j)=0;

   end;

end;

if UIEV=. or UIEV=-4 then do;

   UIEV=0;

   ouiev=-4;

end;

 

** Create important date variables by the YYYYMM scheme and the CMS:

   ymb   - Date of Birth in YYYYMM scheme

   cmb   - Date of Birth in CMS

   ym14  - Date of 14th birthday in YYYYMM scheme

   cm14  - Date of 14th birthday in CMS

   dliym - month after DLI in YYYYMM scheme

   dlicm - month after DLI in CMS

   cdli  - DLI in CMS

   iym   - DCI in YYYYMM scheme

   doicm - DCI in CMS

   mnthaf - month after CDI

   aaiym - Age at DCI in YYYYMM scheme

   aaicm - Age at DCI in CMS;

 

ymb=(doby*100)+dobm;

cmb=((doby-1980)*12)+dobm;

ym14=ymb+1400;

cm14=cmb+(14*12);

 

if inty>0 and intm>0 then do;

   iym=(inty*100)+intm;

   doicm=((inty-1980)*12)+intm;

   mnthaf=doicm+1;

   aaiym=iym-ymb;

   aaicm=doicm-cmb;

end;

 

if inty in (-1,-2,-3) or intm in (-1,-2,-3) then do;

   iym=-3;

   doicm=-3;

   aaiym=-3;

   aaicm=-3;

end;

 

do z=1 to 12;

   mon(z)=z;

end;

 

do z=1 to 12;

   if mon(z) in (1,3,5,7,8,10,12) then ndy(z)=31;

   if mon(z)=2 then ndy(z)=28;

   if mon(z) in (4,6,9,11) then ndy(z)=30;

end;

 

** Create variables pertaining to the DLI;

if p1210=1 then do;

   do i=1 to dim(intmR);

      if i=dli_rnd then do;

         if intmR(i)<12 then dliym=(intyR(i)*100)+(intmR(i)+1);

         if intmR(i)=12 then dliym=((intyR(i)+1)*100)+1;

         dlicm=((intyR(i)-1980)*12)+(intmR(i)+1);

         cdli=((intyR(i)-1980)*12)+intmR(i);

         dli_d=intdR(i);

         dli_m=dliym-round(dliym,100);

         dli_y=round(dliym,100)/100;

      end;

   end;

end;

 

if p1210~=1 then do;

   dliym=ym14;

   dli_d=dobd;

   dli_m=dobm;

   dli_y=doby+14;

   dlicm=cm14;

   cdli=cm14-1;

end;

 

do z=1 to 12;

   if dli_m=mon(z) then ddliday=ndy(z)+1-dli_d;

end;

 

if dli_m=1 or dli_m=8 then do;

   dliday=(31-dli_d+31);

   dliday1=31-dli_d;

   dliday2=31;

end;

if dli_m=3 then do;

   dliday=(28-dli_d+31);

   dliday1=28-dli_d;

   dliday2=31;

end;

if dli_m in (5,7,10,12) then do;

   dliday=(30-dli_d+31);

   dliday1=30-dli_d;

   dliday2=31;

end;

if dli_m in (4,6,9,11) then do;

   dliday=(31-dli_d+30);

   dliday1=31-dli_d;

   dliday2=30;

end;

if dli_m=2 then do;

   dliday=(31-dli_d+28);

   dliday1=31-dli_d;

   dliday2=28;

end;

 

 

********************************************************************************************************

**                      Create variables using informaiton from current round.                        **

 

** Merge values of "currently receiving" variable from two different sections of the questionnaire;

if ps1897>-3 then p3500=ps1897;

 

 

** Change values of weekly amount received from UNEMP COMP to daily values.;

do p=1 to dim(csm);

   if incm(p)>0 then inc(p)=incm(p)/7;

   if incm(p)<=0 then inc(p)=incm(p);

end;

 

** Initialize all UIREC from the date of birth to DCI to zero.;

do l=cmb to doicm;

   UIREC(l)=0;

end;

 

** Initialize the following counters to zero. ;

uickr=0;   * Counter for UIREC>0 but UIAMT is missing;

uicka=0;   * Counter for UIAMT is not missing (>=0 or -3) but UIREC=0;

uickv=0;   * Counter for UIREC is invalid but UIAMT not invalid;

uiodttl=0; * Counter for total number of months received abnormally high amounts;

samemth=0; * 1-0: indicator for spells starting and ending in the same month;

 

 ********************************************************************************************************

**  Define the start date and end dates.                                                                       **

**  (1) If Respondent reports still receiving, then use DCI as the temporary end date for the last    **

**      loop reported. In the next survey round, Respondent will be asked if he/she is still          **

**      receiving. If not, then a permanent end date equivalent to the stop date reported in the next **

**      round will be assigned.                                                                      **

**  (2) If start or end dates are missing, impute those dates. Users will be able to tell what was    **

**      imputed by looking at the following participation flag variable created during the program.   **

**      The categories are the following:                                                                        **

**             1=R reported participation dates                                                       **

**             2=start month imputed                                                                  **

**             3=start month and year imputed                                                         **

**             4=stop month imputed                                                                   **

**             5=stop month and year imputed                                                          **

**             6=start and stop dates imputed                                                         **

**             7=error in data due to round 7 questionnaire problems or inconsistent response.        **

**               In both those these cases we are not sure whether Respondents received in these      **

**               months or not.                                                                       **

**               QUESTIONNAIRE ERROR: These Respondents report a valid start and stop date but are    **

**                                    never asked the follow-up question - if they received again.    **

**               CONFLICTING RESPONSE: These Respondents report currently receiving, a valid start    **

**                                     date and a valid stop date that is different from the DCI but  **

**                                     in the follow-up question as to whether they received again,   **

**                                     they answer NO.                                                **

********************************************************************************************************;

 

**** Create start and stop dates of welfare spells - format YYYYMM;

 

do p=1 to dim(csm);                                                                         /** [B1] **/

 

   *** (1) Set start date if both start month and start year are valid;

   if ys(p)>0 and ms(p)>0 then do;

      yms(p)=(ys(p)*100)+ms(p);

 

      ** Set start day, if given. Or else, use estimated start day, if given.;

      if ds(p)>0 or es(p)>0 then do;

         if ms(p) in (1,3,5,7,8,10,12) then do;

            if ds(p)>0 and ds(p)~=. then sdy(p)=(32-ds(p));

            if es(p)=1 then sdy(p)=31;

            if es(p)=2 then sdy(p)=21;

            if es(p)=3 then sdy(p)=11;

         end;

         if ms(p) in (4,6,9,11) then do;

            if ds(p)>0 and ds(p)~=. then sdy(p)=(31-ds(p));

            if es(p)=1 then sdy(p)=30;

            if es(p)=2 then sdy(p)=20;

            if es(p)=3 then sdy(p)=10;

         end;

         if ms(p)=2 then do;

            if ds(p)>0 and ds(p)~=. then sdy(p)=(29-ds(p));

            if es(p)=1 then sdy(p)=28;

            if es(p)=2 then sdy(p)=18;

            if es(p)=3 then sdy(p)=8;

         end;

      end;

   end;

 

   ** Set start date to DLI if receiving at DLI.;

   if dli(p)=1 then do;

      yms(p)=dliym;

      sdy(p)=dliday;

      if ps1930=1 then do;

         yme(p)=iym;

         edy(p)=intd;

         nogaps=1;

      end;

   end;

 

   ** Set end date to DCI if currently receiving.;

   if cur(p)=1 then do;

      yme(p)=iym;

      edy(p)=intd;

   end;

 

   ** Set end date if both end month and end year are valid.;

   if ye(p)>0 and me(p)>0 then do;

      yme(p)=(ye(p)*100)+me(p);

      * set end day, if given.;

      if de(p)>0 and de(p)~=. then do;

         edy(p)=de(p);

      end;

      * if end day unknown, use estimated end day, if given.;

      if de(p)<0 and ee(p)>0 and ee(p)~=. then do;

         if ee(p)=1 then edy(p)=9;

         if ee(p)=2 then edy(p)=19;

         if ee(p)=3 then edy(p)=28;

      end;

   end;

 

   ** if end month greater than DCI, constrain by DCI.;

   if yme(p)>iym then do;

      yme(p)=iym;

      edy(p)=intd;

   end;

 

   if yms(p)>0 and yme(p)>=dliym then efl(p)=1;

   if yms(p)>0 and yme(p)<dliym then nefl(p)=1;

 

   ** determine estimated months received from estimated weeks received variable.;

   if wks(p)>=0 and (ys(p)<0 or ms(p)<0 or ye(p)<0 or me(p)<0) then do;

      mos(p)=floor(wks(p)/4.3);

   end;

 

   agfl(p)=0;

 

   if ys(p)>0 and ys(p)<1990 then agfl(p)=1;

 

 

   *** (2) if start year is known and start month is unknown.;

   if ys(p)>0 and -3<=ms(p)<=-1 then do;

 

      ** If estimated weeks are known and currently receiving, then count backwards by the number of

         estimated weeks from DCI. If the number of estimated weeks falls short of the start year, the

         start month is December of that year. If the number of estimated weeks is past the start year,

         then the start month is January of that year.;

      if (wks(p)>=0 and cwks(p)=1) then do;

         yme(p)=iym;

         edy(p)=intd;

         if 0<=mos(p)<=(intm-1) then yms(p)=yme(p)-mos(p);

         do k=1 to 13;

            A=k*88;

            if (intm+(k*12)-12)<=mos(p)<=(intm+(k*12)-1) then yms(p)=yme(p)-A-mos(p);

         end;

         do z=1 to 12;

            if (yms(p)-(round(yms(p), 100)))=mon(z) then sdy(p)=ndy(z);

         end;

         if yms(p)<((ys(p)*100)+01) then do;

            yms(p)=((ys(p)*100)+01);

            sdy(p)=31;

         end;

         if yms(p)<dliym then do;

            yms(p)=dliym;

            sdy(p)=ddliday;

         end;

         if yms(p)>((ys(p)*100)+12) then do;

            yms(p)=((ys(p)*100)+12);

            sdy(p)=31;

         end;

      end;

 

      ** Estimated weeks missing and currently receiving - set end date to DCI and start date to December

         of start year and constrain start date by DCI and DLI.;

      else if (-3<=wks(p)<0 and cwks(p)=1) then do;

         yme(p)=iym;

         edy(p)=intd;

         yms(p)=((ys(p)*100)+12);

         sdy(p)=31;

         if yms(p)>iym then do;

            yms(p)=iym;

            sdy(p)=intd;

         end;

         if yms(p)<dliym then do;

            yms(p)=dliym;

            sdy(p)=ddliday;

         end;

      end;

 

      ** Estimated weeks missing and not currently receiving - set start date to January of start year

         and end date to December of start year. Constrain start date by DLI and end date by DCI.;

      else if (-3<=wks(p)<0 and cwks(p)=0) then do;

         yms(p)=((ys(p)*100)+01);

         sdy(p)=31;

         yme(p)=((ys(p)*100)+12);

         edy(p)=31;

         if yms(p)<dliym then do;

            yms(p)=dliym;

            sdy(p)=ddliday;

         end;

         if yme(p)>iym then do;

            yme(p)=iym;

            edy(p)=intd;

         end;

      end;

 

      ** If estimated weeks are known and not currently receiving, then count forward by the number of

         estimated weeks from January of the start year. Constrain start date by DLI. If the count

         exceeds DCI then stop counting at DCI.;

      else if (wks(p)>=0 and cwks(p)=0) then do;

         yms(p)=((ys(p)*100)+01);

         sdy(p)=31;

         if yms(p)<dliym then do;

            yms(p)=dliym;

            sdy(p)=ddliday;

         end;

         nms(p)=yms(p)- ROUND(yms(p),100);

         if 0<=mos(p)<=(12-nms(p)) then yme(p)=yms(p)+mos(p);

         do k=1 to 13;

            A=k*88;

            if ((k*12)+1-nms(p))<=mos(p)<=((k*12)+12-nms(p)) then yme(p)=yms(p)+A+mos(p);

         end;

         do z=1 to 12;

            if (yme(p)-(round(yme(p), 100)))=mon(z) then edy(p)=ndy(z);

         end;

         if yme(p)>iym then do;

            yme(p)=iym;

            edy(p)=intd;

         end;

      end;

 

      if yme(p)>0 and wks(p)=-4 then do;

         yms(p)=((ys(p)*100)+01);

         sdy(p)=31;

      end;

 

      if yms(p)<dliym then do;

         yms(p)=dliym;

         sdy(p)=ddliday;

      end;

 

      if yms(p)>((ys(p)*100)+12) then do;

         yms(p)=((ys(p)*100)+12);

         sdy(p)=31;

      end;

 

      efl(p)=2;

 

   end;

 

 

   *** (3) If start year is unknown.;

   if -3<=ys(p)<=-1 then do;

 

      ** If currently receiving and estimated weeks are known then count back from DCI.;

      if (wks(p)>=0 and cwks(p)=1) then do;

         if 0<=mos(p)<=(intm-1) then yms(p)=yme(p)-mos(p);

         do k=1 to 13;

            A=k*88;

            if (intm+(k*12)-12)<=mos(p)<=(intm+(k*12)-1) then yms(p)=yme(p)-A-mos(p);

         end;

         do z=1 to 12;

            if yms(p)-(round(yms(p),100))=mon(z) then sdy(p)=ndy(z);

         end;

         yme(p)=iym;

         edy(p)=intd;

         if yms(p)<dliym then do;

            yms(p)=dliym;

            sdy(p)=ddliday;

         end;

      end;

 

      ** If currently receiving and estimated weeks are unknown then take DLI as start date if this is

         the first loop. Otherwise take the month after the stop date for the last spell as the start

         date. Take DCI as stop date.;

      if (-3<=wks(p)<0 and cwks(p)=1) and (p=1 or p=(dim(csm)/2)+1) then do;

         yms(p)=dliym;

         yme(p)=iym;

         sdy(p)=ddliday;

         edy(p)=intd;

      end;

      if (-3<=wks(p)<0 and cwks(p)=1) and (1<p<=dim(csm)/2 or (dim(csm)/2)+1<p<=dim(csm)) then do;

         yms(p)=yme(p-1)+1;

         yme(p)=iym;

         do z=1 to 12;

            if (yms(p)-(round(yms(p), 100)))=mon(z) then sdy(p)=ndy(z);

         end;

         edy(p)=intd;

      end;

 

 

      ** If estimated weeks are known and currently not receiveing, then count back from DCI or stop

         date if known to find the most recent year Respondent could have begun receiving. Set start

         date as January of that year. Then count forward from January of that year and set the stop

         date. Constrain start and stop dates by DLI and DCI, respectively.;

      if wks(p)>=0 and cwks(p)=0 and yme(p)<=0 then do;

         if 0<=mos(p)<=intm then do;

            yms(p)=(inty*100)+01;

            yme(p)=(inty*100)+01+mos(p);

         end;

         do k=1 to 13;

            if (intm+(k*12)-11)<=mos(p)<=(intm+(k*12)) then do;

                yms(p)=((inty-k)*100)+01;

                if 0<=mos(p)<=(k*12)     then yme(p)=((inty-1)*100)+01+mos(p)-(k*12)+12;

                if    mos(p)>=((k*12)+1) then yme(p)= (inty*100)   +01+mos(p)-(k*12)   ;

            end;

         end;

 

         sdy(p)=31;

         do z=1 to 12;

            if (yme(p)-(round(yms(p),100)))=mon(z) then edy(p)=ndy(z);

         end;

         if yme(p)>iym then do;

            yme(p)=iym;

            edy(p)=intd;

         end;

      end;

 

      else if wks(p)>=0 and cwks(p)=0 and yme(p)>0 then do;

         if 0<=mos(p)<=me(p) then do;

            yms(p)=(inty*100)+01;

            yme(p)=(ye(p)*100)+01+mos(p);

         end;

         do k=1 to 13;

            if (me(p)+(k*12)-11)<=mos(p)<=(me(p)+(k*12)) then do;

                yms(p)=((ye(p)-k)*100)+01;

                if 0<=mos(p)<=(k*12)     then yme(p)=((ye(p)-1)*100)+01+mos(p)-(k*12)+12;

                if    mos(p)>=((k*12)+1) then yme(p)= (ye(p)*100)   +01+mos(p)-(k*12)   ;

            end;

         end;

         sdy(p)=31;

         do z=1 to 12;

            if (yme(p)-(round(yms(p),100)))=mon(z) then edy(p)=ndy(z);

         end;

         if yme(p)>iym then do;

            yme(p)=iym;

            edy(p)=de(p);

            if ee(p)=1 then edy(p)=9;

            if ee(p)=2 then edy(p)=19;

            if ee(p)=3 then edy(p)=28;

         end;

      end;

 

      efl(p)=3;

 

   end;

 

   if yme(p)>0 and yms(p)=. then do;

     if p=1 or p=(dim(csm)/2)+1 then do;

        yms(p)=dliym;

        sdy(p)=ddliday;

     end;

     if 1<p<=dim(csm)/2 or (dim(csm)/2)+1<p<=dim(csm) then do;

        yms(p)=yme(p-1)+1;

        do z=1 to 12;

           if (yms(p)-(round(yms(p), 100)))=mon(z) then sdy(p)=ndy(z);

        end;

     end;

 

     if p=1 or p=(dim(csm)/2)+1 then efl(p)=3;

     else if ( 2<=p<=dim(csm)/2 or (dim(csm)/2)+2<=p<=dim(csm) ) then efl(p)=7;

   end;

 

   *** Note: if either stop month or year is greater than or equal to -3 then it implies that this

             unemp spell has ended. Even if Respondent reports currently receiving that would imply

             another loop.;

 

 

   *** (4) If stop year is known and stop month is unknown.;

   if yms(p)>0 and ye(p)>0 and -3<=me(p)<=-1 then do;

 

      ** If estimated weeks are known, then count forward from start year. If this estimated start month

         falls short of the stop year, then use January of the end year as the stop date. If this

         estimated start month exceeds the stop year, then use December of the stop year. Constrain stop

         date by DCI. If currently receiving then use DCI as the stop date.;

      if wks(p)>=0 then do;

         nms(p)=yms(p)- round (yms(p),100);

         if 0<=mos(p)<=(12-nms(p)) then yme(p)=yms(p)+mos(p);

         do k=1 to 13;

            A=k*88;

            if ((k*12)+1-nms(p))<=mos(p)<=((k*12)+12-nms(p)) then yme(p)=yms(p)+A+mos(p);

         end; *DELETED6;

         do z=1 to 12;

            if yme(p)-round(yme(p),100)=mon(z) then edy(p)=ndy(z);

         end;

         if yme(p)>((ye(p)*100)+12) then do;

            yme(p)=((ye(p)*100)+12);

            edy(p)=31;

         end;

         if yme(p)<((ye(p)*100)+01) then do;

            yme(p)=((ye(p)*100)+01);

            edy(p)=31;

         end;

         if yme(p)>iym then do;

            yme(p)=iym;

            edy(p)=intd;

         end;

      end;

 

      ** If estimated weeks are unknown, then set December of stop year as the stop month.;

      if -3<=wks(p)<0 then do;

         yme(p)=((ye(p)*100)+12);

         edy(p)=31;

      end;

 

      if yme(p)>iym then do;

         yme(p)=iym;

         edy(p)=intd;

      end;

 

      if (efl(p) not in (2,3,7) or efl(p)=.) then efl(p)=4;

      if efl(p) in (2,3,7) then efl(p)=6;

 

   end;

 

   *** (5) If stop year is unknown.;

   if -3<=ye(p)<=-1 then do;

 

      ** If estimated weeks are known then count forward from the start date and constrain stop date by

         DCI.;

      if yms(p)>0 and wks(p)>=0 then do;

         nms(p)=yms(p)- round (yms(p),100);

         if (              0)<=mos(p)<=(12-nms(p)+  0) then yme(p)=yms(p)+mos(p);

         do k=1 to 13;

            A=k*88;

            if ((k*12)+1-nms(p))<=mos(p)<=((k*12)+12-nms(p)) then yme(p)=yms(p)+A+mos(p);

         end;

         do z=1 to 12;

            if yme(p)-round(yme(p),100)=mon(z) then edy(p)=ndy(z);

         end;

         if yme(p)>iym then do;

            yme(p)=iym;

            edy(p)=intd;

         end;

      end;

 

      ** If estimatedweeks are unknown then set stop date as December of start year.;

      if yms(p)>0 and -3<=wks(p)<0 then do;

         yme(p)=(round (yms(p),100))+12;

         edy(p)=31;

      end;

 

      if yme(p)>iym then do;

         yme(p)=iym;

         edy(p)=intd;

      end;

 

      if (efl(p) not in (2,3,7) or efl(p)=.) then efl(p)=5;

      if efl(p) in (2,3,7) then efl(p)=6;

 

   end;

 

   *** (6) If the start and stop years are unknown and the estimated weeks are unknown, use DCI and DLI.;

   if -3<=ys(p)<=-1 and cwks(p)=0 and -3<=wks(p)<0 then do;

      yme(p)=iym;

      edy(p)=intd;

      yms(p)=dliym;

      sdy(p)=ddliday;

 

      if p=1 or p=(dim(csm)/2)+1 then efl(p)=6;

      else if (2<=p<=dim(csm)/2 or (dim(csm)/2)+2<=p<=dim(csm)) then efl(p)=7;

 

   end;

 

 

   *****************************************************************************************************

   **  Calculate the number of days receiving if start and end year and months are the same.          **

 

   if (yms(p)=yme(p) and yms(p)>0 and edy(p)>=0 and sdy(p)>=0) then do;

      samemth=1;

      ** If the month has 31 days.;

      if (yms(p)-round(yms(p),100)) in (1,3,5,7,8,10,12) then do;

         if edy(p)>=(32-sdy(p)) then do;

            sdy(p)=edy(p)-(32-sdy(p))+1;

            edy(p)=0;

         end;

         else if edy(p)<(32-sdy(p)) then do;

            sdy(p)=0;

            edy(p)=0;

            handedit=handedit+1;

         end;

      end;

      ** If the month has 30 days.;

      if (yms(p)-round(yms(p),100)) in (4,6,9,11) then do;

         if edy(p)>=(31-sdy(p)) then do;

            sdy(p)=edy(p)-(31-sdy(p))+1;

            edy(p)=0;

         end;

         else if edy(p)<(31-sdy(p)) then do;