Variables Created:
CV_INCOME_GROSS_YR
CV_HH_POV_RATIO
Variables Used
| Name in Program | Question Name in Data | Name in Program | Question Name in Data | |
| YI_1400 | YINC-1400 | YI_5000 | YINC-5000 | |
| YI_1600 | YINC-1600 | YI_5100 | YINC-5100 | |
| YI_1700 | YINC-1700 | YI_5200 | YINC-5200 | |
| YI_1800 | YINC-1800 | YI_5300 | YINC-5300 | |
| YI_2000 | YINC-2000 | YI_5400 | YINC-5400 | |
| YI_2100 | YINC-2100 | YI_5700A | YINC-5700A | |
| YI_2200 | YINC-2200 | YI_5900A | YINC-5900A | |
| YI_2250 | YINC-2250 | YI_7600 | YINC-7600 | |
| YI_2260 | YINC-2260 | YI_7700 | YINC-7700 | |
| YI_2270 | YINC-2270 | YI_7800 | YINC-7800 | |
| YI_2300 | YINC-2300 | YI_8050 | YINC-8050 | |
| YI_2400 | YINC-2400 | YI_8700 | YINC-8700 | |
| YI_2500 | YINC-2500 | YI_8800 | YINC-8800 | |
| YI_2600 | YINC-2600 | YI_8900 | YINC-8900 | |
| YI_2700 | YINC-2700 | YI_9200 | YINC-9200 | |
| YI_2900 | YINC-2900 | YI_9300 | YINC-9300 | |
| YI_3000 | YINC-3000 | YI_9400 | YINC-9400 | |
| YI_3100 | YINC-3100 | YI_9600 | YINC-9600 | |
| YI_3150 | YINC-3150 | YI_9700 | YINC-9700 | |
| YI_3300 | YINC-3300 | YI_9800 | YINC-9800 | |
| YI_3900 | YINC-3900 | YI_9900 | YINC-9900 | |
| YI_4000 | YINC-4000 | YI_10100 | YINC-10100 | |
| YI_4100 | YINC-4100 | YI_10200 | YINC-10200 | |
| YI_4200 | YINC-4200 | YI_10300 | YINC-10300 | |
| YI_4300 | YINC-4300 | YI_10400 | YINC-10400 | |
| YI_4400 | YINC-4400 | YI_11600A | YINC-11600A | |
| YI_4500 | YINC-4500 | YI_11700 | YINC-11700 | |
| YI_4600 | YINC-4600 | PUBID | PUBID | |
| YI_4700 | YINC-4700 | HIRELY01-HIRELY13 | HHI_RELY.01-.13 | |
| YI_4800 | YINC-4800 | from1-from21 |
YINC-5800A~000001- YINC-5800A~000021 |
|
| YI_4900 | YINC-4900 |
This program creates the gross household income variables. 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 thresholds 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 two variables are topcoded to protect respondent privacy. More information about topcoding is available in the NLSY97 User's Guide.
*****************SECTION 1: GROSS HOUSEHOLD INCOME*****************
*******************************************************************;
***********income from non-farm employment, nfarmY*****************;
*******************************************************************;
nfarmY=-4; /*assign a default value to nfarmY*/
if YI_1400=1 or ((YI_1400 in (-1,-2,-3)) and (YI_1600 eq 1)) then do;
flag_nfarmY=1; /* 1 means R has non-farm income*/
/* 2 means R has non-farm income, however the amount is an estimate.*/
if YI_1700 >= 0 then nfarmY=YI_1700;
else if YI_1700 in (-1,-2,-3) then do; /*R does not give the exact number.*/
if YI_1800 eq 1 then do; /*begin the estimating */
flag_nfarmY=2;
nfarmY=2500;
end;
else if YI_1800 eq 2 then do;
flag_nfarmY=2;
nfarmY=7500;
end;
else if YI_1800 eq 3 then do;
flag_nfarmY=2;
nfarmY=17500;
end;
else if YI_1800=4 then do;
nfarmY=37500;
flag_nfarmY=2;
end;
else if YI_1800=5 then do;
nfarmY=75000;
flag_nfarmY=2;
end;
else if YI_1800=6 then do;
nfarmY=175000;
flag_nfarmY=2;
end;
else if YI_1800=7 then do;
nfarmY=250001;
flag_nfarmY=2;
end;
end;
end;
if YI_1600=-1 or YI_1800=-1 then nfarmY=-1;/*R refuse to answer */
else if YI_1600=-2 or YI_1800=-2 then nfarmY=-2;/*R don't know */
else if YI_1600=-3 or YI_1800=-3 then nfarmY=-3;/*R invalid skip */
********************this is the end of non-farm income*****************;
**************************************************************************;
*** Income from farm and self-employment of respondent - (farmY)**********;
**************************************************************************;
farmY=-4; /*assign a default value to farmY */
if YI_2000=1 then do;
flag_farmY=1; /*R has farm income */
if YI_2100 >= 0 then farmY=YI_2100;/*get the amount of farm income */
else if YI_2100 in (-1,-2,-3) then do;/*R don't give the exact number */
if YI_2200=1 then do; /*begin to estimate the farm income */
farmY=-2;
end;
else if YI_2200=2 then do;
farmY=2500;
flag_farmY=2;
end;
else if YI_2200=3 then do;
farmY=7500;
flag_farmY=2;
end;
else if YI_2200=4 then do;
farmY=17500;
flag_farmY=2;
end;
else if YI_2200=5 then do;
farmY=37500;
flag_farmY=2;
end;
else if YI_2200=6 then do;
farmY=75000;
flag_farmY=2;
end;
else if YI_2200=7 then do;
farmY=175000;
flag_farmY=2;
end;
else if YI_2200=8 then do;
farmY=250001;
flag_farmY=2;
end;
end;
end;
if YI_2000=-1 or YI_2200=-1 then farmY=-1;
else if YI_2000=-2 or YI_2200=-2 then farmY=-2;
else if YI_2000=-3 or YI_2200=-3 then farmY=-3;
****************this is the end of farm income.************************;
***********************************************************************;
**********************Worker's Compensation,wcompY*********************;
***********************************************************************;
wcompY=-4;
if YI_2250=1 then do;
flag_wcompY=1;
if YI_2260>=0 then wcompY=YI_2260;
else if YI_2260 in (-1,-2,-3) then do;
*if 2<=YI_2270<=8 then flag_wcompY=2;
if YI_2270=1 then do;
flag_wcompY=2;
wcompY=500; /*then what is flag_wcomY?*/
end;
else if YI_2270=2 then do;
wcompY=1750;
flag_wcompY=2;
end;
else if YI_2270=3 then do;
wcompY=3750;
flag_wcompY=2;
end;
else if YI_2270=4 then do;
wcompY=7500;
flag_wcompY=2;
end;
else if YI_2270=5 then do;
wcompY=17500;
flag_wcompY=2;
end;
else if YI_2270=6 then do;
wcompY=37500;
flag_wcompY=2;
end;
else if YI_2270=7 then do;
wcompY=50001;
flag_wcompY=2;
end;
end;
end;
if YI_2250=-1 or YI_2270=-1 then wcompY=-1; /*R refuse to answer. */
else if YI_2250=-2 or YI_2270=-2 then wcompY=-2; /*R don't know. */
else if YI_2250=-3 or YI_2270=-3 then wcompY=-3; /*invalid skip */
***************this is the end of worker's
compensation.**************************;
**********************************************************************************;
*****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;
else if YI_2600 in (-1,-2,-3) then do;
if YI_2700=1 then do;
nfarmP=2500;
flag_nfarmP=2;
end;
else if YI_2700=2 then do;
nfarmP=7500;
flag_nfarmP=2;
end;
else if YI_2700=3 then do;
nfarmP=17500;
flag_nfarmP=2;
end;
else if YI_2700=4 then do;
nfarmP=37500;
flag_nfarmP=2;
end;
else if YI_2700=5 then do;
nfarmP=75000;
flag_nfarmP=2;
end;
else if YI_2700=6 then do;
nfarmP=175000;
flag_nfarmP=2;
end;
else if YI_2700=7 then do;
nfarmP=250001;
flag_nfarmP=2;
end;
end;
end;
if YI_2300=-1 or YI_2500=-1 or YI_2700=-1 then nfarmP=-1;
else if YI_2300=-2 or YI_2400=-2 or YI_2500=-2 or YI_2700=-2 then nfarmP=-2;
else if YI_2300=-3 or YI_2400=-3 or YI_2500=-3 or YI_2700=-3 then nfarmP=-3;
**************this is the end of non-farm income from
partner/spouse.*************;
***********************************************************************************;
******Income from farm and self-employment of R'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;
else 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;
else if YI_3100=2 then do;
farmP=2500;
flag_farmP=2;
end;
else if YI_3100=3 then do;
farmP=7500;
flag_farmP=2;
end;
else if YI_3100=4 then do;
farmP=17500;
flag_farmP=2;
end;
else if YI_3100=5 then do;
farmP=37500;
flag_farmP=2;
end;
else if YI_3100=6 then do;
farmP=75000;
flag_farmP=2;
end;
else if YI_3100=7 then do;
farmP=175000;
flag_farmP=2;
end;
else if YI_3100=8 then do;
farmP=250001;
flag_farmP=2;
end;
end;
end;
if YI_2300=-1 or YI_2900=-1 or YI_3100=-1 then farmP=-1;
else if YI_2300=-2 or YI_2900=-2 or YI_3100=-2 then farmP=-2;
else if YI_2300=-3 or YI_2900=-3 or YI_3100=-3 then farmP=-3;
***************this is the end of farm income of R's
partner/spouse***************;
***********************************************************************************;
*************** worker's compensation from R's partner/spouse -
wcompP*************;
***********************************************************************************;
wcompP=-4;
if YI_2300=1 & YI_3150=1 then do;
flag_wcompP=1;
if YI_3160>=0 then wcompP=YI_3160;
else if YI_3160 in (-1,-2,-3) then do;
*if 1<=YI_3170<=7 then flag_wcompP=2;
if YI_3170=1 then do;
wcompP=500;
flag_wcompP=2;
end;
else if YI_3170=2 then do;
wcompP=1250;
flag_wcompP=2;
end;
else if YI_3170=3 then do;
wcompP=3750;
flag_wcompP=2;
end;
else if YI_3170=4 then do;
wcompP=7500;
flag_wcompP=2;
end;
else if YI_3170=5 then do;
wcompP=17500;
flag_wcompP=2;
end;
else if YI_3170=6 then do;
wcompP=37500;
flag_wcompP=2;
end;
else if YI_3170=7 then do;
wcompP=50001;
flag_wcompP=2;
end;
end;
end;
if YI_2300=-1 or YI_3150=-1 or YI_3170=-1 then wcompP=-1;
else if YI_2300=-1 or YI_3150=-2 or YI_3170=-2 then wcompP=-2;
else if YI_2300=-1 or YI_3150=-3 or YI_3170=-3 then wcompP=-3;
***************this is the end of worker's compensation from R's
partner/spouse******;
**************************************************************************************;
*** 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;
else 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 do;
chsup=500;
flag_chsup=2;
end;
else if YI_4200=2 then do;
chsup=1750;
flag_chsup=2;
end;
else if YI_4200=3 then do;
chsup=3750;
flag_chsup=2;
end;
else if YI_4200=4 then do;
chsup=7500;
flag_chsup=2;
end;
else if YI_4200=5 then do;
chsup=17500;
flag_chsup=2;
end;
else if YI_4200=6 then do;
chsup=37500;
flag_chsup=2;
end;
else if YI_4200=7 then do;
chsup=50001;
flag_chsup=2;
end;
end;
end;
if YI_3300=-1 or YI_3900=-1 or YI_4000=-1 or YI_4200=-1 then chsup=-1;
else if YI_3300=-2 or YI_3900=-2 or YI_4000=-2 or YI_4200=-2 then chsup=-2;
else if YI_3300=-1 or YI_3900=-1 or YI_4000=-3 or YI_4200=-3 then chsup=-3;
***********************this is end of child
support**************************************;
****************************************************************************************;
*** Interest payments received by the respondent and r's partner/spouse - intrst
*******;
****************************************************************************************;
intrst=-4;
if YI_4300=1 then do;
flag_intrst=1;
if YI_4400>=0 then intrst=YI_4400;
else if YI_4400 in (-1,-2,-3) then do;
*if 1<=YI_4500<=7 then flag_intrst=2;
if YI_4500=1 then do;
intrst=250;
flag_intrst=2;
end;
else if YI_4500=2 then do;
intrst=750;
flag_intrst=2;
end;
else if YI_4500=3 then do;
intrst=1750;
flag_intrst=2;
end;
else if YI_4500=4 then do;
intrst=3750;
flag_intrst=2;
end;
else if YI_4500=5 then do;
intrst=6250;
flag_intrst=2;
end;
else if YI_4500=6 then do;
intrst=8750;
flag_intrst=2;
end;
else if YI_4500=7 then do;
intrst=10001;
flag_intrst=2;
end;
end;
end;
if YI_4300=-1 or YI_4500=-1 then intrst=-1;
else if YI_4300=-2 or YI_4500=-2 then intrst=-2;
else if YI_4300=-3 or YI_4500=-3 then intrst=-3;
*****************this is the end of interest.******************************;
********************************************************************************;
** Dividends from stocks & mutual funds received by the respondent
*************;
** and his/her partner/spouse - dividend
****************************************;
********************************************************************************;
dvdend=-4;
if YI_4600=1 then do;
flag_dvdend=1;
if YI_4700>=0 then dvdend=YI_4700;
else if YI_4700 in (-1,-2,-3) then do;
*if 1<=YI_4800<=7 then flag_dvdend=2;
if YI_4800=1 then do;
dvdend=250;
flag_dvdend=2;
end;
else if YI_4800=2 then do;
dvdend=750;
flag_dvdend=2;
end;
else if YI_4800=3 then do;
dvdend=1750;
flag_dvdend=2;
end;
else if YI_4800=4 then do;
dvdend=3750;
flag_dvdend=2;
end;
else if YI_4800=5 then do;
dvdend=6250;
flag_dvdend=2;
end;
else if YI_4800=6 then do;
dvdend=8750;
flag_dvdend=2;
end;
else if YI_4800=7 then do;
dvdend=10001;
flag_dvdend=2;
end;
end;
end;
if YI_4600=-1 or YI_4800=-1 then dvdend=-1;
else if YI_4600=-2 or YI_4800=-2 then dvdend=-2;
else if YI_4600=-3 or YI_4800=-3 then dvdend=-3;
************* this is the end of dividends. *****************************;
************************************************************************************;
*** 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;
else if YI_5000 in (-1,-2,-3) then do;
if YI_5100=1 then do;
rntinc=500;
flag_rntinc=2;
end;
else if YI_5100=2 then do;
rntinc=1750;
flag_rntinc=2;
end;
else if YI_5100=3 then do;
rntinc=3750;
flag_rntinc=2;
end;
else if YI_5100=4 then do;
rntinc=7500;
flag_rntinc=2;
end;
else if YI_5100=5 then do;
rntinc=17500;
flag_rntinc=2;
end;
else if YI_5100=6 then do;
rntinc=37500;
flag_rntinc=2;
end;
else if YI_5100=7 then do;
rntinc=50001;
flag_rntinc=2;
end;
end;
end;
if YI_4900=-1 or YI_5100=-1 then rntinc=-1;
else if YI_4900=-2 or YI_5100=-2 then rntinc=-2;
else if YI_4900=-3 or YI_5100=-3 then rntinc=-3;
******************* this is the end of rental income. *************************;
********************************************************************************;
*** 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;
else 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;
else if YI_5400=2 then astinc=7500;
else if YI_5400=3 then astinc=17500;
else if YI_5400=4 then astinc=37500;
else if YI_5400=5 then astinc=75000;
else if YI_5400=6 then astinc=175000;
else if YI_5400=7 then astinc=250001;
end;
end;
if YI_5200=-1 or YI_5400=-1 then astinc=-1;
else if YI_5200=-2 or YI_5400=-2 then astinc=-2;
else if YI_5200=-3 or YI_5400=-3 then astinc=-3;
************ this is the end of estate,trusts,annuities or inheritances.
*********;
/****************************************************************
*** income as gift from friends or family: gftinc ***
****************************************************************/
/**************************************************************************/
/* Gift part has a great change. So, we create a varible, giftFrom, to */
/* indicate if the gifts all from outside, all inside, or both. Following */
/* codes create the varible giftfrom. */
/**************************************************************************/
array HIRELY (*) HIRELY01-HIRELY12; /* check who is in the household. */
do i=1 to dim(hirely);
if hirely(i)=3 then mother_in=1;
else if hirely(i)=4 then father_in=1;
else if hirely(i)=7 then Smother_in=1;
else if hirely(i)=8 then Sfather_in=1;
else if hirely(i)=11 then mil_in=1;
else if hirely(i)=12 then fil_in=1;
else if hirely(i) in (13,15,21) then sister_in=1;
else if hirely(i) in (14,18,22) then brother_in=1;
else if hirely(i)=27 then bil_in=1;
else if hirely(i)=28 then sil_in=1;
else if hirely(i)=29 then gmother_in=1;
else if hirely(i)=33 then gfather_in=1;
else if hirely(i)=61 then gmil_in=1;
else if hirely(i)=62 then gfil_in=1;
else if hirely(i)=69 then partner_in=1;
else if hirely(i)=85 then nonrel_in=1;
else if hirely(i)=84 then rel_in=1;
else if hirely(i) in (1,2,37,41,45,46,47,48,49,50,51,52,59,60,61,62,
63,64,65,66,67,70,71,72,73,74,75,78,79,82,83,86,87)
then gftothrel_in=1;
end;
/***********************************/
/* inside=0 from outside; */
/* inside=1 from inside; */
/* inside=2 don't know. */
/***********************************/
array inside(*) inside1-inside20;
do i=1 to dim(inside);
inside(i)=-3;
end;
array from(*) from1-from20;
if from1=1 then do;
if mother_in=1 and father_in=1 then inside1=1;
else if mother_in^=1 and father_in^=1 then inside1=0;
else inside1=2;
end;
if from2=1 then do;
if mother_in=1 then inside2=1;
else inside2=0;
end;
if from3=1 then do;
if father_in=1 then inside3=1;
else inside3=0;
end;
if from4=1 then do;
if mother_in=1 and Sfather_in=1 then inside4=1;
else if mother_in^=1 and Sfather_in^=1 then inside4=0;
else inside4=2;
end;
if from5=1 then do;
if father_in=1 and Smother_in=1 then inside5=1;
else if father_in^=1 and Smother_in^=1 then inside5=0;
else inside5=2;
end;
if from6=1 then do;
if Sfather_in=1 then inside6=1;
else inside6=0;
end;
if from7=1 then do;
if Smother=1 then inside7=1;
else inside7=0;
end;
if from8=1 then do;
if sister_in^=1 and brother_in^=1 then inside8=0;
else inside8=2;
end;
if from9=1 then do;
if gmother_in=1 and gfather_in=1 then inside9=1;
else if gmother^=1 and gfather^=1 then inside9=0;
else inside9=2;
end;
if from10=1 then do;
if mil_in=1 and fil_in=1 then inside10=1;
else if mil_in^=1 and fil_in^=1 then inside10=0;
else inside10=2;
end;
if from11=1 then do;
if mil_in=1 then inside11=1;
else inside11=0;
end;
if from12=1 then do;
if fil_in=1 then inside12=1;
else inside12=0;
end;
if from13=1 then do;
if mil_in=1 and fil_in=1 then inside13=1;
else if mil_in^=1 and fil_in^=1 then inside13=0;
else inside13=2;
end;
if from14=1 then do;
if mil_in=1 and fil_in=1 then inside14=1;
else if mil_in^=1 and fil_in^=1 then inside14=0;
else inside14=2;
end;
if from15=1 then do;
if fil_in=1 then inside15=1;
else inside15=0;
end;
if from16=1 then do;
if mil_in=1 then inside16=1;
else inside16=0;
end;
if from17=1 then do;
if bil_in^=1 and sil_in^=1 then inside17=0;
else inside17=2;
end;
if from18=1 then do;
if gmil_in=1 and gfil_in=1 then inside18=1;
else if gmil_in^=1 and gfil_in^=1 then inside18=0;
else inside18=2;
end;
if from19=1 then do;
if gftothrel_in=1 or rel_in=1 then inside19=2;
else if gftothrel_in^=1 and rel_in^=1 then inside19=0;
end;
if from20=1 then do;
if nonrel_in=1 then inside20=2;
else inside20=0;
end;
if partner_in=1 and nonrel_in=1 then do;
do i=10 to 18;
if from(i)=1 then inside(i)=2;
end;
end;
flag0=0;
flag1=0;
flag2=0;
do i=1 to dim(inside);
if inside(i)=0 then flag0=1; /*from outside*/
else if inside(i)=1 then flag1=1; /*from inside*/
else if inside(i)=2 then flag2=1; /* don't knonw*/
end;
if flag1=0 and flag2=0 and flag0=1 then giftfrom=0; /*all from outside*/
else if flag2=0 and flag0=0 and flag1=1 then giftfrom=1; /*all from inside*/
else if flag0=1 and flag1=1 and flag2=0 then giftfrom=2; /*part */
else if flag2=1 then giftfrom=-3; /* don't knonw*/
if giftfrom=. then giftfrom=-3;
/************** This is the end of giftfrom. *********************************/
gftinc=-4;
gftinc2=-4;
if YI_5700A=1 then do;
flag_gftinc=1;
if YI_5900A=1 then gftinc=250;
if YI_5900A=2 then gftinc=750;
if YI_5900A=3 then gftinc=1750;
if YI_5900A=4 then gftinc=3750;
if YI_5900A=5 then gftinc=6250;
if YI_5900A=6 then gftinc=8750;
if YI_5900A=7 then gftinc=10001;
end;
if giftfrom=0 then gftinc2=gftinc; /* giftfrom=0 means all gift from outside. */
else if giftfrom=1 then gftinc2=0; /* giftfrom=1 means all gift from inside. */
else if giftfrom=2 and gftinc<=1000 then gftinc2=gftinc; /* giftfrom=2 means
gift from both sources; if */
else if giftfrom=2 and gftinc>1000 then gftinc2=-3; /* amount<=1000, then add
it; otherwise, -3. */
else if giftfrom=-3 and gftinc<=1000 then gftinc2=gftinc; /* giftfrom=-3 means
don't know from where. if */
else if giftfrom=-3 and gftinc>1000 then gftinc2=-3; /* amount<=1000 then add
it; otherwise, -3. */
if YI_5700A=-1 or YI_5900A=-1 then do; gftinc=-1; gftinc2=-1; end;
if YI_5700A=-2 or YI_5900A=-2 then do; gftinc=-2; gftinc2=-2; end;
if YI_5700A=-3 or YI_5900A=-3 then do; gftinc=-3; gftinc2=-3; end;
********************* this is the end of gift income. ****************
***********************************************************************************;
*** 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;
else 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;
else if YI_7800=2 then othinc=1750;
else if YI_7800=3 then othinc=3750;
else if YI_7800=4 then othinc=7500;
else if YI_7800=5 then othinc=17500;
else if YI_7800=6 then othinc=37500;
else if YI_7800=7 then othinc=50001;
end;
end;
if YI_7600=-1 or YI_7800=-1 then othinc=-1;
else if YI_7600=-2 or YI_7800=-2 then othinc=-2;
else if YI_7600=-3 or YI_7800=-3 then othinc=-3;
*************** this is the end of other income.
***********************************;
/*******************************************************************************/
/**** Income from father/father like or/and mother/mother like ***/
/**** the condition is R's age as of 12/31/2003 is less than 25. ***/
/*******************************************************************************/
dadinc=-4;
mominc=-4;
mlginc=-4;
fmginc=-4;
if YI_8050=0 then do;
do i=1 to dim(HIRELY);
if HIRELY(i)=3 then lv_mom=1;
else if HIRELY(i)=4 then lv_dad=1;
else if HIRELY(i) in (6,8,10) then lv_odad=1;
else if HIRELY(i) in (5,7,9) then lv_omom=1;
end;
******************************************************************************;
*** Income from Father. ***;
*** Note: Identify whether the respondent's father lives in the household. ***;
******************************************************************************;
dadinc=-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;
else 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;
else if YI_8900=2 then dadinc=7500;
else if YI_8900=3 then dadinc=17500;
else if YI_8900=4 then dadinc=37500;
else if YI_8900=5 then dadinc=75000;
else if YI_8900=6 then dadinc=175000;
else if YI_8900=7 then dadinc=250001;
end;
end;
if YI_8700=-1 or YI_8900=-1 then dadinc=-1;
else if YI_8700=-2 or YI_8900=-2 then dadinc=-2;
else if YI_8700=-3 or YI_8900=-3 then dadinc=-3;
end;
*** this is the end of dadinc *****;
*************************************************************************************;
*** Income from Mother. **********;
*** Note: Identify whether the respondent's mother lived in the household.
**********;
*************************************************************************************;
mominc=-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;
else 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;
else if YI_9400=2 then mominc=7500;
else if YI_9400=3 then mominc=17500;
else if YI_9400=4 then mominc=37500;
else if YI_9400=5 then mominc=75000;
else if YI_9400=6 then mominc=175000;
else if YI_9400=7 then mominc=250001;
end;
end;
if YI_9200=-1 or YI_9400=-1 then mominc=-1;
else if YI_9200=-2 or YI_9400=-2 then mominc=-2;
else if YI_9200=-3 or YI_9400=-3 then mominc=-3;
end;
***** this is the end of mominc *********;
*****************************************************;
*** 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;
else 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;
else if YI_9900=2 then mlginc=7500;
else if YI_9900=3 then mlginc=17500;
else if YI_9900=4 then mlginc=37500;
else if YI_9900=5 then mlginc=75000;
else if YI_9900=6 then mlginc=175000;
else if YI_9900=7 then mlginc=250001;
end;
end;
if YI_9700=-1 or YI_9900=-1 then mlginc=-1;
else if YI_9700=-2 or YI_9900=-2 then mlginc=-2;
else if YI_9700=-3 or YI_9900=-3 then mlginc=-3;
end;
*********** the end of mlginc. ***************;
*******************************************************;
*** 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;
else 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;
else if YI_10400=2 then fmginc=7500;
else if YI_10400=3 then fmginc=17500;
else if YI_10400=4 then fmginc=37500;
else if YI_10400=5 then fmginc=75000;
else if YI_10400=6 then fmginc=175000;
else if YI_10400=7 then fmginc=250001;
end;
end;
if YI_10200=-1 or YI_10400=-1 then fmginc=-1;
else if YI_10200=-2 or YI_10400=-2 then fmginc=-2;
else if YI_10200=-3 or YI_10400=-3 then fmginc=-3;
end;
**************** the end of fmginc. ******************;
end;
/**********************************************************************/
/**** Income from other family members living with R: othfaminc ***/
/**********************************************************************/
othfaminc=-4;
if YI_11600A>0 then do;
othfaminc=YI_11600A;
flag_othfaminc=1;
end;
else if YI_11600A in (-1, -2,-3) then do;
if 1<=YI_11700<=7 then flag_othfaminc=2;
if YI_11700=1 then othfaminc=2500;
else if YI_11700=2 then othfaminc=7500;
else if YI_11700=3 then othfaminc=17500;
else if YI_11700=4 then othfaminc=37500;
else if YI_11700=5 then othfaminc=75000;
else if YI_11700=6 then othfaminc=175000;
else if YI_11700=7 then othfaminc=250001;
end;
if YI_11700=-1 then othfaminc=-1;
else if YI_11700=-2 then othfaminc=-2;
else if YI_11700=-3 then othfaminc=-3;
******* this is the end of othfaminc *******;
************************************************************************************;
*** 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 gftinc2 othinc mominc
dadinc mlginc fmginc othfaminc prgamt ;
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_gftinc
flag_othinc
flag_mominc flag_dadinc flag_mlginc flag_fmginc
flag_othfaminc flag_prgamt;
groshhIY=0;
do i=1 to dim(varsY);
if varsY(i) not in (-1,-2,-3,-4) then groshhIY=groshhIY+varsY(i);
else if varsY(i) in (-1,-2,-3) then flgsY(i)=varsY(i);
end;
groshhIY=round(groshhIY,1);
***********************************************************************;
*** 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;
else if varsY(i)=-2 then do;
groshhIY=-2;
invskpGIY=2;
end;
else 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 8. ***;
***************************************************************;
if YI_1400=-5 then do;
groshhIY=-5;
nonintGIY=1;
end;
*****************Section 2: Household Poverty Status*****************
*** Create the poverty thresholds taken from U.S.Census' website ***;
*** - http://www.census.gov/hhes/poverty/threshld/thresh04.html ***
**Poverty Thresholds for 2004 by Size of Family and Number of Related Children
Under 18 Years
| Size of family unit | Related children under 18 years | ||||||||
| None | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 or more | |
| One person (unrelated individual) | |||||||||
| Under 65 years | 9,827 | ||||||||
| 65 years and over | 9,060 | ||||||||
| Two persons | |||||||||
| Householder under 65 years | 12,649 | 13,020 | |||||||
| Householder 65 years and over | 11,418 | 12,971 | |||||||
| Three persons |
14,776 |
15,205 |
15,219 |
||||||
| Four persons |
19,484 |
19,803 |
19,157 |
19,223 |
|||||
| Five persons |
23,497 |
23,838 |
23,108 |
22,543 |
22,199 |
||||
| Six persons |
27,025 |
27,133 |
26,573 |
26,037 |
25,241 |
24,768 |
|||
| Seven persons |
31,096 |
31,290 |
30,621 |
30,154 |
29,285 |
28,271 |
27,159 |
||
| Eight persons |
34,778 |
35,086 |
34,454 |
33,901 |
33,115 |
32,119 |
31,082 |
30,818 |
|
| Nine persons or more |
41,836 |
42,039 |
41,480 |
41,010 |
40,240 |
39,179 |
38,220 |
37,983 |
36,520 |
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=9827;
else if under18=1 then povert=9827;
end;
else if hhsize=2 then do;
if under18=0 then povert=12649;
else if under18=1 then povert=13020;
else if under18=2 then povert=13020;
end;
else if hhsize=3 then do;
if under18=0 then povert=14776;
else if under18=1 then povert=15205;
else if under18=2 then povert=15219;
else if under18=3 then povert=15219;
end;
else if hhsize=4 then do;
if under18=0 then povert=19484;
else if under18=1 then povert=19803;
else if under18=2 then povert=19157;
else if under18=3 then povert=19223;
else if under18=4 then povert=19223;
end;
else if hhsize=5 then do;
if under18=0 then povert=23497;
else if under18=1 then povert=23838;
else if under18=2 then povert=23108;
else if under18=3 then povert=22543;
else if under18=4 then povert=22199;
else if under18=5 then povert=22199;
end;
else if hhsize=6 then do;
if under18=0 then povert=27025;
else if under18=1 then povert=27133;
else if under18=2 then povert=26573;
else if under18=3 then povert=26037;
else if under18=4 then povert=25241;
else if under18=5 then povert=24768;
else if under18=6 then povert=24768;
end;
else if hhsize=7 then do;
if under18=0 then povert=31096;
else if under18=1 then povert=31290;
else if under18=2 then povert=30621;
else if under18=3 then povert=30154;
else if under18=4 then povert=29285;
else if under18=5 then povert=28271;
else if under18=6 then povert=27159;
else if under18=7 then povert=27159;
end;
else if hhsize=8 then do;
if under18=0 then povert=34778;
else if under18=1 then povert=35086;
else if under18=2 then povert=34454;
else if under18=3 then povert=33901;
else if under18=4 then povert=33115;
else if under18=5 then povert=32119;
else if under18=6 then povert=31082;
else if under18=7 then povert=30818;
else if under18=8 then povert=30818;
end;
else if hhsize>=9 then do;
if under18=0 then povert=41836;
else if under18=1 then povert=42039;
else if under18=2 then povert=41480;
else if under18=3 then povert=41010;
else if under18=4 then povert=40240;
else if under18=5 then povert=39179;
else if under18=6 then povert=38220;
else if under18=7 then povert=37983;
else if under18>=8 then povert=36520;
end;
****** this is the end of threshold. ******;
*******************************************************************************;
*** Compute the respondent's gross household income to poverty level ratio. ***;
*******************************************************************************;
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 YI_1400=-5 then do;
povthr=-5;
nonintPOV=1;
end;
if groshhIY in (-1,-2) then groshhIY=-3;
if povthr in (-1,-2) then povthr=-3;
reincome=.;
reratio=.;
if groshhIY ge 0 then reincome=groshhIY;
if povthr ge 0 then reratio=povthr;
run;
endsas;
Variables Created:
CV_GOVNT_PRG_EVER
CV_GOVNT_PRG_YR.80 - CV_GOVNT_PRG_YR.99, CV_GOVNT_PRG_YR.00 - CV_GOVNT_PRG_YR.06
CV_AMT_GOVNT_PCM_PCY.80 - CV_AMT_GOVNT_PCM_PCY.99, CV_AMT_GOVNT_PCM_PCY.00 - CV_AMT_GOVNT_PCM_PCY.06
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.Variable descriptions are as follows:
CV_GOVNT_PRG_YR.XX -
indicates the number of months in any given year (from 1980 to 2006)
that R received any or all of the four programs - 1)Aid to Families with
Dependent Children, 2)Women, Infant & Children, 3)Food Stamps and
4)Other Assistance.
CV_GOVNT_PRG_EVER - indicates
the total number of months (from 1980 to 2006) that R received any or
all of the above four programs
CV_AMT_GOVNT_PCM_PCY.XX - indicates the amount received in any or all of the above programs by R in any given year (from 1980 to 2006).
| Created variable name on CD | Created variable name in this program |
| CV_GOVNT_PRG_EVER | GPEV |
| CV_GOVNT_PRG_YR.XX | GPRTTLXX |
| CV_AMT_GOVNT_PCM_PCY.XX | GPATTLXX |
HE=0;
** Hand edits using information from all rounds;
if pubid = 8757 then do;
ps197001=0; ps191401=1; ps21100a1=1; ps212001=0; ps212002=-4;
ps19100m2=-4; ps19100y2=-4; ps197002=-4; ps191402=-4; ps207002=-4; ps208002=-4;
ps21100a2=-4;
ps19100m3=-4; ps19100y3=-4; ps197003=-4; ps191403=-4; ps207003=-4; ps208003=-4;
ps21100a3=-4;
ps209001_2=-4; ps209002_2=-4; ps209003_2=-4; ps209004_2=-4; ps209005_2=-4;
ps209001_3=-4; ps209002_3=-4; ps209003_3=-4; ps209004_3=-4; ps209005_3=-4;
end;
if pubid = 7140 then do;
ps21900a1=-4; ps223001=-4; ps238001=-4; ps22000m2=-4; ps22000y2=-4;
ps22600m1=-4; ps22600y1=-4; ps228001=-4; ps233001=-4; ps23700a1=-4;
ps22600m2=-4; ps22600y2=-4; ps228002=-4; ps233002=-4; ps23700a2=-4;
ps235001_1=-4; ps235002_1=-4; ps235003_1=-4; ps235004_1=-4; ps235005_1=-4;
ps235001_2=-4; ps235002_2=-4; ps235003_2=-4; ps235004_2=-4; ps235005_2=-4;
end;
if pubid = 7644 then do;
ps329001=0;
ps31000m2=-4; ps31000y2=-4; ps31600m2=-4; ps31600y2=-4; ps318002=-4;
ps323002=-4; ps324002=-4;
ps31000m3=-4; ps31000y3=-4; ps31600m3=-4; ps31600y3=-4; ps318003=-4;
ps323003=-4; ps324003=-4;
ps325001_2=-4; ps325002_2=-4; ps325003_2=-4; ps325004_2=-4; ps325005_2=-4;
ps325001_3=-4; ps325002_3=-4; ps325003_3=-4; ps325004_3=-4; ps325005_3=-4;
end;
***** Create dataset for those not interviewed or not eligible for program
participation;
if p1210 in (-5,-4);
array GPRTTL (27) GPRTTL80-GPRTTL99 GPRTTL00 GPRTTL01-GPRTTL06;
array GPATTL (27) GPATTL80-GPATTL99 GPATTL00 GPATTL01-GPATTL06;
do i=1 to dim(GPRTTL);
if p1210=-5 then do;
GPRTTL(i)=-5;
GPATTL(i)=-5;
end;
if p1210=-4 then do;
GPRTTL(i)=-4;
GPATTL(i)=-4;
end;
end;
if p1210=-5 then GPEV=-5;
if p1210=-4 then GPEV=-4;
***** Create dataset for those interviewed and eligible for program
participation;
data int; set merged;
if p1210>-4;
intd=intdr9;
intm=intmr9;
inty=intyr9;
array dtps (*) dtps1-dtps9;
array dtp1 (*) dtpa1 dtpw1 dtpf1 dtpo1;
array dtp2 (*) dtpa2 dtpw2 dtpf2 dtpo2;
array dtp3 (*) dtpa3 dtpw3 dtpf3 dtpo3;
array dtp4 (*) dtpa4 dtpw4 dtpf4 dtpo4;
array dtp5 (*) dtpa5 dtpw5 dtpf5 dtpo5;
array dtp6 (*) dtpa6 dtpw6 dtpf6 dtpo6;
array dtp7 (*) dtpa7 dtpw7 dtpf7 dtpo7;
array dtp8 (*) dtpa8 dtpw8 dtpf8 dtpo8;
array dtp9 (4) dtpa9 dtpw9 dtpf9 dtpo9;
array dtp22 (4,8) dtp2a11-dtp2a14 dtp2a21-dtp2a24
dtp2w11-dtp2w14 dtp2w21-dtp2w24
dtp2f11-dtp2f14 dtp2f21-dtp2f24
dtp2o11-dtp2o14 dtp2o21-dtp2o24;
array dtp33 (4,8) dtp3a11-dtp3a14 dtp3a21-dtp3a24
dtp3w11-dtp3w14 dtp3w21-dtp3w24
dtp3f11-dtp3f14 dtp3f21-dtp3f24
dtp3o11-dtp3o14 dtp3o21-dtp3o24;
array dtp99 (4,8) dtp9a11-dtp9a14 dtp9a21-dtp9a24
dtp9w11-dtp9w14 dtp9w21-dtp9w24
dtp9f11-dtp9f14 dtp9f21-dtp9f24
dtp9o11-dtp9o14 dtp9o21-dtp9o24;
do i=1 to dim(dtps);
dtps(i)=0;
end;
do p=1 to 4;
dtp1(p)=0; dtp2(p)=0; dtp3(p)=0; dtp4(p)=0;
dtp5(p)=0; dtp6(p)=0; dtp7(p)=0; dtp8(p)=0; dtp9(p)=0;
do q=1 to 8;
dtp22(p,q)=0; dtp33(p,q)=0; dtp99(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
CMS - Continuous month scheme
AFDC - Aid to Families with Dependent Children
WIC - Women, Infants and Children
FST - Food Stamps
OTH - Other Assistance
CV - Created Variables;
************************************************ PART I
************************************************
** Define all the arrays used in this program **
********************************************************************************************************;
** (1) Created Variables;
array GPRTTL (27) GPRTTL80-GPRTTL99 GPRTTL00 GPRTTL01-GPRTTL06;
array GPATTL (27) GPATTL80-GPATTL99 GPATTL00 GPATTL01-GPATTL06;
** (2) Information from prior rounds;
* Interview month.;
array intmR (8) intmR1-intmR8;
* Interview year.;
array intyR (8) intyR1-intyR8;
* no. of months ever received.;
array gpevR (8) gpevR1-gpevR8;
* no. of months received in a given year.;
array gprttlR (8,27) gpr1ttl80-gpr1ttl99 gpr1ttl00 gpr1ttl01-gpr1ttl06
gpr2ttl80-gpr2ttl99 gpr2ttl00 gpr2ttl01-gpr2ttl06
gpr3ttl80-gpr3ttl99 gpr3ttl00 gpr3ttl01-gpr3ttl06
gpr4ttl80-gpr4ttl99 gpr4ttl00 gpr4ttl01-gpr4ttl06
gpr5ttl80-gpr5ttl99 gpr5ttl00 gpr5ttl01-gpr5ttl06
gpr6ttl80-gpr6ttl99 gpr6ttl00 gpr6ttl01-gpr6ttl06
gpr7ttl80-gpr7ttl99 gpr7ttl00 gpr7ttl01-gpr7ttl06
gpr8ttl80-gpr8ttl99 gpr8ttl00 gpr8ttl01-gpr8ttl06;
* amount received in a given year.;
array gpattlR (8,27) gpa1ttl80-gpa1ttl99 gpa1ttl00 gpa1ttl01-gpa1ttl06
gpa2ttl80-gpa2ttl99 gpa2ttl00 gpa2ttl01-gpa2ttl06
gpa3ttl80-gpa3ttl99 gpa3ttl00 gpa3ttl01-gpa3ttl06
gpa4ttl80-gpa4ttl99 gpa4ttl00 gpa4ttl01-gpa4ttl06
gpa5ttl80-gpa5ttl99 gpa5ttl00 gpa5ttl01-gpa5ttl06
gpa6ttl80-gpa6ttl99 gpa6ttl00 gpa6ttl01-gpa6ttl06
gpa7ttl80-gpa7ttl99 gpa7ttl00 gpa7ttl01-gpa7ttl06
gpa8ttl80-gpa8ttl99 gpa8ttl00 gpa8ttl01-gpa8ttl06;
* start date for each spell;
array csmR (8,4,4) csma_R1_1-csma_R1_4 csmw_R1_1-csmw_R1_4 csmf_R1_1-csmf_R1_4
csmo_R1_1-csmo_R1_4
csma_R2_1-csma_R2_4 csmw_R2_1-csmw_R2_4 csmf_R2_1-csmf_R2_4 csmo_R2_1-csmo_R2_4
csma_R3_1-csma_R3_4 csmw_R3_1-csmw_R3_4 csmf_R3_1-csmf_R3_4 csmo_R3_1-csmo_R3_4
csma_R4_1-csma_R4_4 csmw_R4_1-csmw_R4_4 csmf_R4_1-csmf_R4_4 csmo_R4_1-csmo_R4_4
csma_R5_1-csma_R5_4 csmw_R5_1-csmw_R5_4 csmf_R5_1-csmf_R5_4 csmo_R5_1-csmo_R5_4
csma_R6_1-csma_R6_4 csmw_R6_1-csmw_R6_4 csmf_R6_1-csmf_R6_4 csmo_R6_1-csmo_R6_4
csma_R7_1-csma_R7_4 csmw_R7_1-csmw_R7_4 csmf_R7_1-csmf_R7_4 csmo_R7_1-csmo_R7_4
csma_R8_1-csma_R8_4 csmw_R8_1-csmw_R8_4 csmf_R8_1-csmf_R8_4 csmo_R8_1-csmo_R8_4;
* stop date for each spell;
array cemR (8,4,4) cema_R1_1-cema_R1_4 cemw_R1_1-cemw_R1_4 cemf_R1_1-cemf_R1_4
cemo_R1_1-cemo_R1_4
cema_R2_1-cema_R2_4 cemw_R2_1-cemw_R2_4 cemf_R2_1-cemf_R2_4 cemo_R2_1-cemo_R2_4
cema_R3_1-cema_R3_4 cemw_R3_1-cemw_R3_4 cemf_R3_1-cemf_R3_4 cemo_R3_1-cemo_R3_4
cema_R4_1-cema_R4_4 cemw_R4_1-cemw_R4_4 cemf_R4_1-cemf_R4_4 cemo_R4_1-cemo_R4_4
cema_R5_1-cema_R5_4 cemw_R5_1-cemw_R5_4 cemf_R5_1-cemf_R5_4 cemo_R5_1-cemo_R5_4
cema_R6_1-cema_R6_4 cemw_R6_1-cemw_R6_4 cemf_R6_1-cemf_R6_4 cemo_R6_1-cemo_R6_4
cema_R7_1-cema_R7_4 cemw_R7_1-cemw_R7_4 cemf_R7_1-cemf_R7_4 cemo_R7_1-cemo_R7_4
cema_R8_1-cema_R8_4 cemw_R8_1-cemw_R8_4 cemf_R8_1-cemf_R8_4 cemo_R8_1-cemo_R8_4;
* edit flag for dates for each spell;
array eflR (8,4,4) efla_R1_1-efla_R1_4 eflw_R1_1-eflw_R1_4 eflf_R1_1-eflf_R1_4
eflo_R1_1-eflo_R1_4
efla_R2_1-efla_R2_4 eflw_R2_1-eflw_R2_4 eflf_R2_1-eflf_R2_4 eflo_R2_1-eflo_R2_4
efla_R3_1-efla_R3_4 eflw_R3_1-eflw_R3_4 eflf_R3_1-eflf_R3_4 eflo_R3_1-eflo_R3_4
efla_R4_1-efla_R4_4 eflw_R4_1-eflw_R4_4 eflf_R4_1-eflf_R4_4 eflo_R4_1-eflo_R4_4
efla_R5_1-efla_R5_4 eflw_R5_1-eflw_R5_4 eflf_R5_1-eflf_R5_4 eflo_R5_1-eflo_R5_4
efla_R6_1-efla_R6_4 eflw_R6_1-eflw_R6_4 eflf_R6_1-eflf_R6_4 eflo_R6_1-eflo_R6_4
efla_R7_1-efla_R7_4 eflw_R7_1-eflw_R7_4 eflf_R7_1-eflf_R7_4 eflo_R7_1-eflo_R7_4
efla_R8_1-efla_R8_4 eflw_R8_1-eflw_R8_4 eflf_R8_1-eflf_R8_4 eflo_R8_1-eflo_R8_4;
* edit flag for amounts for each spell;
array aflR (8,4,4) afla_R1_1-afla_R1_4 aflw_R1_1-aflw_R1_4 aflf_R1_1-aflf_R1_4
aflo_R1_1-aflo_R1_4
afla_R2_1-afla_R2_4 aflw_R2_1-aflw_R2_4 aflf_R2_1-aflf_R2_4 aflo_R2_1-aflo_R2_4
afla_R3_1-afla_R3_4 aflw_R3_1-aflw_R3_4 aflf_R3_1-aflf_R3_4 aflo_R3_1-aflo_R3_4
afla_R4_1-afla_R4_4 aflw_R4_1-aflw_R4_4 aflf_R4_1-aflf_R4_4 aflo_R4_1-aflo_R4_4
afla_R5_1-afla_R5_4 aflw_R5_1-aflw_R5_4 aflf_R5_1-aflf_R5_4 aflo_R5_1-aflo_R5_4
afla_R6_1-afla_R6_4 aflw_R6_1-aflw_R6_4 aflf_R6_1-aflf_R6_4 aflo_R6_1-aflo_R6_4
afla_R7_1-afla_R7_4 aflw_R7_1-aflw_R7_4 aflf_R7_1-aflf_R7_4 aflo_R7_1-aflo_R7_4
afla_R8_1-afla_R8_4 aflw_R8_1-aflw_R8_4 aflf_R8_1-aflf_R8_4 aflo_R8_1-aflo_R8_4;
** (3) Intermediate variables - latest created variables available from prior
rounds.;
* ogpev - no. of months ever received.;
* no. of months recd., yearly;
array ogprttl (27) ogprttl80-ogprttl99 ogprttl00 ogprttl01-ogprttl06;
* amount recd., yearly;
array ogpattl (27) ogpattl80-ogpattl99 ogpattl00 ogpattl01-ogpattl06;
* 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) (Raw data) Information available from current round.;
* START YEAR information;
array ys (4,8) ps35800y1-ps35800y4 p16700y1-p16700y4
ps22000y1-ps22000y4 p22000y1-p22000y4
ps19100y1-ps19100y4 p19400y1-p19400y4
ps31000y1-ps31000y4 p31000y1-p31000y4;
* START MONTH information;
array ms (4,8) ps35800m1-ps35800m4 p16700m1-p16700m4
ps22000m1-ps22000m4 p22000m1-p22000m4
ps19100m1-ps19100m4 p19400m1-p19400m4
ps31000m1-ps31000m4 p31000m1-p31000m4;
* END YEAR information;
array ye (4,8) ps35840y1-ps35840y4 p17200y1-p17200y4
ps22600y1-ps22600y4 p22600y1-p22600y4
ps20000y1-ps20000y4 p20000y1-p20000y4
ps31600y1-ps31600y4 p31600y1-p31600y4;
* END MONTH information;
array me (4,8) ps35840m1-ps35840m4 p17200m1-p17200m4
ps22600m1-ps22600m4 p22600m1-p22600m4
ps20000m1-ps20000m4 p20000m1-p20000m4
ps31600m1-ps31600m4 p31600m1-p31600m4;
* CURRENTLY RECEIVING information - NO GAPS;
array cur (4,8) ps359501-ps359504 p169001-p169004
ps23700a1-ps23700a4 p222001-p222004
ps21100a1-ps21100a4 p196001-p196004
ps32700a1-ps32700a4 p312001-p312004;
* CURRENTLY RECEIVING information - 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+ MONTHS.;
array stpgp (4,8) ps358301-ps358304 p170001-p170004
ps223001-ps223004 p223001-p223004
ps197001-ps197004 p197001-p197004
ps313001-ps313004 p313001-p313004;
* RECEIVE AGAIN;
array recag (4,8) ps359601-ps359604 p186001-p186004
ps238001-ps238004 p238001-p238004
ps212001-ps212004 p212001-p212004
ps329001-ps329004 p329001-p329004;
* PERSON RECEIVING, R;
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 (324) AREC001-AREC324; array AAMT (324) AAMT001-AAMT324; array AHHM
(324) AHHM001-AHHM324;
array WREC (324) WREC001-WREC324; array WAMT (324) WAMT001-WAMT324; array WHHM
(324) WHHM001-WHHM324;
array FREC (324) FREC001-FREC324; array FAMT (324) FAMT001-FAMT324; array FHHM
(324) FHHM001-FHHM324;
array OREC (324) OREC001-OREC324; array OAMT (324) OAMT001-OAMT324; array OHHM
(324) OHHM001-OHHM324;
array ALLAMT (4,324) AAMT001-AAMT324 WAMT001-WAMT324 FAMT001-FAMT324
OAMT001-OAMT324;
array ALLREC (4,324) AREC001-AREC324 WREC001-WREC324 FREC001-FREC324
OREC001-OREC324;
array ALLHHM (4,324) AHHM001-AHHM324 WHHM001-WHHM324 FHHM001-FHHM324
OHHM001-OHHM324;
* ttlg - no. of months ever received.;
* no. of months received, yearly.;
array gm (27) gm80-gm99 gm00 gm01-gm06;
* amount received, yearly.;
array gamt(27) gamt80-gamt99 gamt00 gamt01-gamt06;
* no. of months with valid amounts.;
array ga (27) ga80-ga99 ga00 ga01-ga06;
* no. of months with invalid amounts.;
array gn (27) gn80-gn99 gn00 gn01-gn06;
* 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 use in 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 recipientcy (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. **
********************************************************************************************************;
** HAND EDIT - If stopped for a month or more is Don't Know then code received
again as ZERO.
If received again question is Don't Know but ask about next spell then code
received again as ONE.
If currently receiving or not is Don't Know then code it as ZERO. Note: If
respondent refuses (-1)
to answer any of these questions we leave the response as
it is;
do i=1 to dim(csm,1);
do j=1 to dim(csm,2);
if stpgp(i,j)=-2 then do;
stpgp(i,j)=0;
HE=HE+1;
imp_stpgp=1;
end;
end;
do j=1 to dim(csm,2);
if cur(i,j)=-2 or cwks(i,j)=-2 then do;
cur(i,j)=0;
cwks(i,j)=0;
HE=HE+1;
imp_currec=1;
end;
end;
end;
do i=1 to dim(csm,1);
do j=1 to (dim(csm,2)/2)-1;
if recag(i,j)=-2 & ye(i,j+1)>-4 then do;
recag(i,j)=1;
HE=HE+1;
imp_recag=1;
end;
end;
do j=(dim(csm,2)/2)+1 to dim(csm,2)-1;
if recag(i,j)=-2 & ye(i,j+1)>-4 then do;
recag(i,j)=1;
HE=HE+1;
imp_recag=1;
end;
end;
end;
rnds=dim(csm,2);
rnds1=dim(csm,2)/2;
** Identify the last round that R 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 the values at 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 those dates for the last
spell reported in 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;
** Take care of cases in earlier rounds;
do j=1 to dim(GPRTTL);
* although R 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 R;
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 R;
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 various important date variables in the two schemes - the YYYYMM
scheme and the continuous
month scheme (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=1 when XREC>0 but XAMT in (.,-4).;
acka=0; wcka=0; fcka=0; ocka=0; * Counter=1 when XREC=0 or XHHM in (.,-4) but
XAMT>-4;
ackh=0; wckh=0; fckh=0; ockh=0; * Counter=1 when XREC=0 or XAMT in (.,-4) but
XHHM>-4;
ackv=0; wckv=0; fckv=0; ockv=0; * Counter=1 when XREC=-3 but XAMT~=-3.;
aodttl=0; wodttl=0; fodttl=0; oodttl=0; * Counter for total no. of months
received the problematic amts.;
*********************************************** PART III
***********************************************
** Create intermediate variables using informaiton from current round. **
********************************************************************************************************;
do p=1 to 4; /** [B1] **/
do q=1 to dim(csm,2); /** [B2] **/
*** Create variables that indicate the start/stop dates for a particular
spell of a
particular program in the yyyymm and CSM formats;
************************************************************************************************
** Define the start date and end dates. If R reports still receiving, then use
DCI as the **
** temporary end date for the last loop reported. In the next survey round, R
will be asked **
** if he or she is still receiving. If not, then a permanent end date equivalent
to the **
** interview date of the last round will be assigned. 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=err_or in data due to round 8 questionnaire problems or inconsistent
response. **
** Both result in us not being sure whether Rs received in these months or not.
**
** QUESTIONNAIRE err_or: These Rs reported valid start and stop dates but were
**
** never asked the follow-up question - if they received again. **
** CONFLICTING RESPONSE: These Rs reported 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 answered NO. **
************************************************************************************************;
** (1) Set start date if both start month and 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 receiving now;
if cur(p,q)=1 then yme(p,q)=iym;
* Set end date if both end month and 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 iff the end date is before DLI. Only in these cases we do not
compute months
receiving variable. So, we use another efl variable just to know the efl value;
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 weeks are known and currently receiving, then count backwards by the number
of weeks from
the DCI. If the number of weeks falls short of the start year, the start month
is December of that year
If the number of 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;
* Weeks missing and currently receiving - 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;
* Weeks missing and not currently receiving - 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 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 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 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 weeks missing and currently receiving - 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;
* weeks are known and not currently receiving then count backward from DCI/or
stop date if
known and set Jan of that year as the start year. Then add the number of months
receiving
and get the stop date. Constrain stop date by DCI;
if wks(p,q)>=0 & cwks(p,q)=0 & 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)>=0 & (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;
if wks(p,q)>=0 & cwks(p,q)=0 & 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;
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 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 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 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 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 the 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;
** (7) If the start year is unknown, stop month is unknown but stop year is
known, and the weeks
are unknown and either currently receiving or R does not know if currently
receiving or not
then use DLI as the start date and December of stop year as stop date. Constrain
stop date
by DCI;
if -3<=ys(p,q)<=-1 and -3<=me(p,q)<=-1 and ye(p,q)>0 and cwks(p,q)<=0 and
-3<=wks(p,q)<0 then do;
yms(p,q)=dliym;
yme(p,q)=((ye(p,q)*100)+12);
if yme(p,q)>iym then yme(p,q)=iym;
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 determined which person in the household receives the
particular spell of the particular program.;
***********************************************************************************
** Define the person in the household receiving the program variable. **
** It collapses the answers to 8 categories. The coding is the following - **
** 1=R only **
** 2=spouse/partner only **
** 3=child only **
** 4=R and spouse/partner **
** 5=R and child **
** 6=spouse/partner and child **
** 7=R and spouse/partner and child **
** 8=other **
** The first 7 categories may include an 'other' person as captured by response
**
** categories 4 (other relatives in household) and 5 (other (specify)) in the **
** original question. If only 'other' person is listed as receiving, then the **
** 8th answer category is used in the created variable. **
***********************************************************************************;
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;
if rcvr(p,q)=0 & rcvs(p,q)=0 & rcvc(p,q)=0 & rcvf(p,q)=0 & rcvo(p,q)=0 then
who(p,q)=-3;
*** 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 R. 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 the category is unbounded - the number
represents 1 **
** dollar above the lower bound. 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;
if inc(p,q)=-4 then inc(p,q)=.;
** Compute edit flags for dates (efls) for those cases that have not already
been computed.;
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;
*** Hand edits - 1;
*****************;
** If R reports good dates for one spell and bad dates for another and these are
overlapping then we
are not sure when either of the spells started and/or stopped. We then impute
the start and stop
dates for both spells as -3. Right now we leave the dates as it is so that the
rest of the program
can run as intended and then right at the end we convert these dates to -3.;
do p=1 to 4;
do q=1 to (dim(csm,2)/2);
do r=1 to (dim(csm,2)/2);
if csm(p,r)<=csm(p,q)<=cem(p,r) & efl(p,q)=1 & efl(p,r)>1 & cem(p,r)>=dlicm>0
then do;
dtp99(p,q)=1;
dtp99(p,r)=1;
dtp9(p)=1;
dtps9=1;
end;
end;
end;
do q=(dim(csm,2)/2)+1 to dim(csm,2);
do r=(dim(csm,2)/2)+1 to dim(csm,2);
if csm(p,r)<=csm(p,q)<=cem(p,r) & efl(p,q)=1 & efl(p,r)>1 & cem(p,r)>=dlicm>0
then do;
dtp99(p,q)=1;
dtp99(p,r)=1;
dtp9(p)=2;
dtps9=2;
end;
end;
end;
end;
** R reports receiving, but doesn't know whether stopped for more than a month
and so we do not have
any information on stop date.;
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;
** When Rs 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;
if dtp2(p)~=-1 then dtp2(p)=1;
if efl(p,q)>1 then dtp2(p)=-1;
dtp22(p,q)=1; dtp22(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 Rs report overlapping spells being received by different persons it
means these are two legit.
spells and so should be counted separately. Our program will however overwrite
the earlier spell amt.
by the latter spell amt. for the overlapping months. To correct for that we have
to hand edit.;
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 Rs 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 determine which of the
two values to put and
when one spell ended and the other started. Identify these cases and then
hand edit 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;
if dtp3(p)~=-1 then dtp3(p)=1;
if efl(p,q)>1 then dtp3(p)=-1;
dtp33(p,q)=1; dtp33(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;
** Rs 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;
** Rs 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 HAND EDIT.;
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 R reports a valid stop date but is not asked whether receives again then
hand edit similar to cases
of dtps5. As for dtps5 cases we do not hand edit 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)=-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 ((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;
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;
** Hand edits using all available information;
if pubid = 663 then do;
csmw11=csmw12; cemw11=cemw12; incw11=incw12; whow11=whow12; eflw11=eflw12;
aflw11=aflw12;
csmw12=.; cemw12=.; incw12=.; whow12=.; eflw12=.; aflw12=.;
end;
if pubid = 3389 then do;
cemw11=doicm;
csmw12=.; cemw12=.; incw12=.; whow12=.; eflw12=.; aflw12=.;
end;
if pubid = 3438 then do;
cemw11=doicm; incw11=-3; eflw11=eflw12;
csmw12=.; cemw12=.; incw12=.; whow12=.; eflw12=.; aflw12=.;
end;
if pubid = 5781 then do;
csmw11=dlicm; cemw11=doicm; eflw11=6;
csmw12=dlicm; cemw12=doicm; eflw12=6;
end;
if pubid = 7524 then do;
whoo11=1;
end;
if pubid = 7353 then do;
inca21=-3;
incw21=-3;
incf21=-3; whof21=-3;
csmf22=.; cemf22=.; incf22=.; whof22=.; eflf22=.; aflf22=.;
end;
if pubid = 8142 then do;
incw11=-3; whow11=-3;
csmw12=.; cemw12=.; incw12=.; whow12=.; eflw12=.; aflw12=.;
end;
*** Create the monthly array variables - those that indicate whether R received
any of the four govt.
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;
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] **/
*** Hand edits - 2;
** R 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
Rs 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 problematic "too 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);
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 (dtp22(p,q)=1|dtp33(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;
** Converting the start and stop dates to -3 for dtps9 cases.;
do p=1 to 4;
do q=1 to (dim(csm,2)/2);
do r=1 to (dim(csm,2)/2);
if dtp99(p,q)=1 & dtp99(p,r)=1 then do;
csm(p,q)=-3; cem(p,q)=-3;
csm(p,r)=-3; cem(p,r)=-3;
end;
end;
end;
do q=(dim(csm,2)/2)+1 to dim(csm,2);
do r=(dim(csm,2)/2)+1 to dim(csm,2);
if dtp99(p,q)=1 & dtp99(p,r)=1 then do;
csm(p,q)=-3; cem(p,q)=-3;
csm(p,r)=-3; cem(p,r)=-3;
end;
end;
end;
end;
if pubid = 5781 then do;
csmw11=-3; cemw11=-3;
csmw12=-3; cemw12=-3;
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 (GIRTTLXX) and
the total amount
received 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 vars1 (*) GPEV GPRTTL80-GPRTTL99 GPRTTL00 GPRTTL01-GPRTTL06;
array vars2 (*) GPATTL80-GPATTL99 GPATTL00 GPATTL01-GPATTL06;
do i=1 to dim(vars1);
if vars1(i) in (-1,-2) then vars1(i)=-3;
end;
do i=1 to dim(vars2);
if vars2(i) in (-1,-2) then vars2(i)=-3;
if vars2(i)>=0 then vars2(i)=round(vars2(i));
end;
endsas;
Variables Created:
Variables Used
The input variables are listed in a separate file.
This program creates several variables describing the respondent's receipt of unemployment compensation:
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.
handedit=0;
if pubid = 4242 then do;
ps4000m1=-4; ps4000y1=-4; ps4700m1=-4; ps4700y1=-4; ps52001=-4; ps59001=-4;
ps60001=-4; ps63001=-4;
ps4000m2=-4; ps4000y2=-4; ps4700m2=-4; ps4700y2=-4; ps52002=-4; ps59002=-4;
ps60002=-4; ps63002=-4;
ps4000m3=-4; ps4000y3=-4; ps4700m3=-4; ps4700y3=-4; ps52003=-4; ps59003=-4;
ps60003=-4; ps63003=-4;
ps4000m4=-4; ps4000y4=-4; ps4700m4=-4; ps4700y4=-4; ps52004=-4; ps59004=-4;
ps60004=-4; ps63004=-4;
handedit=1;
end;
***** Create dataset for those not interviewed or not eligible for program
participation;
if p1210 in (-5,-4);
array UIRTTL (27) UIRTTL80-UIRTTL99 UIRTTL00 UIRTTL01-UIRTTL06;
array UIATTL (27) UIATTL80-UIATTL99 UIATTL00 UIATTL01-UIATTL06;
array UISPLS (27) UISPLS80-UISPLS99 UISPLS00 UISPLS01-UISPLS06;
do j=1 to dim(UIRTTL);
if p1210=-5 then do;
UIRTTL(j)=-5;
UIATTL(j)=-5;
UISPLS(j)=-5;
end;
if p1210=-4 then do;
UIRTTL(j)=-4;
UIATTL(j)=-4;
UISPLS(j)=-4;
end;
end;
if p1210=-5 then UIEV=-5;
if p1210=-4 then UIEV=-4;
***** Create dataset for those interviewed and eligible for program
participation;
data int; set merged;
if p1210>-4;
intd=intdr9;
intm=intmr9;
inty=intyr9;
array dataprb (*) dataprb1-dataprb8;
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
UNEMP - Unemployment Compensation.;
*** All the arrays used in this program.;
** (1) Created Variables - yearly.;
array UIRTTL (27) UIRTTL80-UIRTTL99 UIRTTL00 UIRTTL01-UIRTTL06;
array UIATTL (27) UIATTL80-UIATTL99 UIATTL00 UIATTL01-UIATTL06;
array UISPLS (27) UISPLS80-UISPLS99 UISPLS00 UISPLS01-UISPLS06;
** (2) Interview dates of prior rounds.;
array intdR (8) intdR1-intdR8; * interview day.;
array intmR (8) intmR1-intmR8; * interview month.;
array intyR (8) intyR1-intyR8; * interview year.;
** (3) Created variables of prior rounds.;
array uievR (8) uievR1-uievR8; * no. of months ever received.;
* no. of months received in a given year.;
array uirttlR (8,27) uir1ttl80-uir1ttl99 uir1ttl00 uir1ttl01-uir1ttl06
uir2ttl80-uir2ttl99 uir2ttl00 uir2ttl01-uir2ttl06
uir3ttl80-uir3ttl99 uir3ttl00 uir3ttl01-uir3ttl06
uir4ttl80-uir4ttl99 uir4ttl00 uir4ttl01-uir4ttl06
uir5ttl80-uir5ttl99 uir5ttl00 uir5ttl01-uir5ttl06
uir6ttl80-uir6ttl99 uir6ttl00 uir6ttl01-uir6ttl06
uir7ttl80-uir7ttl99 uir7ttl00 uir7ttl01-uir7ttl06
uir8ttl80-uir8ttl99 uir8ttl00 uir8ttl01-uir8ttl06;
* amount received in a given year.;
array uiattlR (8,27) uia1ttl80-uia1ttl99 uia1ttl00 uia1ttl01-uia1ttl06
uia2ttl80-uia2ttl99 uia2ttl00 uia2ttl01-uia2ttl06
uia3ttl80-uia3ttl99 uia3ttl00 uia3ttl01-uia3ttl06
uia4ttl80-uia4ttl99 uia4ttl00 uia4ttl01-uia4ttl06
uia5ttl80-uia5ttl99 uia5ttl00 uia5ttl01-uia5ttl06
uia6ttl80-uia6ttl99 uia6ttl00 uia6ttl01-uia6ttl06
uia7ttl80-uia7ttl99 uia7ttl00 uia7ttl01-uia7ttl06
uia8ttl80-uia8ttl99 uia8ttl00 uia8ttl01-uia8ttl06;
* no. of spells started in a given year.;
array uisplsR (8,27) ui1spls80-ui1spls99 ui1spls00 ui1spls01-ui1spls06
ui2spls80-ui2spls99 ui2spls00 ui2spls01-ui2spls06
ui3spls80-ui3spls99 ui3spls00 ui3spls01-ui3spls06
ui4spls80-ui4spls99 ui4spls00 ui4spls01-ui4spls06
ui5spls80-ui5spls99 ui5spls00 ui5spls01-ui5spls06
ui6spls80-ui6spls99 ui6spls00 ui6spls01-ui6spls06
ui7spls80-ui7spls99 ui7spls00 ui7spls01-ui7spls06
ui8spls80-ui8spls99 ui8spls00 ui8spls01-ui8spls06;
* start date of each spell.;
array csmR (8,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
csmuR7_1-csmuR7_4
csmuR8_1-csmuR8_4;
* start date of each spell.;
array cemR (8,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
cemuR7_1-cemuR7_4
cemuR8_1-cemuR8_4;
* edit flag for dates for each spell.;
array eflR (8,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
efluR7_1-efluR7_4
efluR8_1-efluR8_4;
** (4) Latest created variables available from prior rounds.;
* ouiev; * no. of months ever received.;
array ouirttl (27) ouirttl80-ouirttl99 ouirttl00 ouirttl01-ouirttl06; * no.
of months rec., yearly;
array ouiattl (27) ouiattl80-ouiattl99 ouiattl00 ouiattl01-ouiattl06; *
amount recd., yearly;
array ouispls (27) ouispls80-ouispls99 ouispls00 ouispls01-ouispls06; * no.
of spells started, yearly.;
** (5) (Raw data) Information available from current round.
The extra loop in these arrays is to impute a new spell for
some problem cases
- dataprb4, dataprb5;
* START YEAR, MONTH, ACTUAL DAY and ESTIMATED DAY information.;
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 information.;
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;
* 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;
array recag (8) ps63001-ps63004 p63001-p63004;
* CURRENTLY RECEIVING information:
For NVPR sections:;
array cur (8) ps44001-ps44004 p44001-p44004;
array cwks (8) ps1930 ps1930 ps1930 ps1930 p3500 p3500 p3500 p3500;
* RECEIVING at DLI
Replaced ps1850 by ps39011 as ps1850 was asked of some Rs only. Others were
asked ps1899. ps39011
combines all these responses.;
array dli (8) ps39011 dum dum dum dum dum dum dum;
** (6) Intermediate variables created based on information available from
current round.;
array UIREC (324) UIREC001-UIREC324; * indicator for receipt, monthly.;
array UIAMT (324) UIAMT001-UIAMT324; * amount received, monthly.;
* ttlu; * no. of months ever received.;
array um (27) um80-um99 um00 um01-um06; * no. of months received, yearly.;
array uamt (27) uamt80-uamt99 uamt00 uamt01-uamt06; * amount received,
yearly.;
array nu (27) nu80-nu99 nu00 nu01-nu06; * no. of spells started, yearly.;
array ua (27) ua80-ua99 ua00 ua01-ua06; * no. of months with valid amounts.;
array un (27) un80-un99 un00 un01-un06; * 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.;
array tcsm (8) tcsmu11-tcsmu14 tcsmu21-tcsmu24; * start date in CMS.;
array tcem (8) tcemu11-tcemu14 tcemu21-tcemu24; * stop date in CMS.;
array tsdy (8) tsdyu11-tsdyu14 tsdyu21-tsdyu24; * start day.;
array tedy (8) tedyu11-tedyu14 tedyu21-tedyu24; * stop day.;
array tinc (8) tincu11-tincu14 tincu21-tincu24; * daily amount.;
array tafl (8) taflu11-taflu14 taflu21-taflu24; * amount flag.;
array tefl (8) teflu11-teflu14 teflu21-teflu24; * date flag.;
******************************************************************************************************
** Initialize the created variables at the value at DLI. Create date of
birth, DCI, DLI etc. in CMS **
** and YYYYMM schemes. **
******************************************************************************************************;
** Identify the last round that R was interviewed (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 those dates 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;
** Take care of cases in earlier rounds;
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 various important date variables in the two schemes - the YYYYMM
scheme and the continuous
month scheme (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 information from current round. **
******************************************************************************************************;
** Change weekly amount received from UNEMP figures to daily figures.;
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=1 when UIREC>0 but UIAMT is missing;
uicka=0; * Counter=1 when UIAMT is not missing (>=0 or -3) but UIREC=0;
uickv=0; * Counter=1 when UIREC is invalid but UIAMT not invalid;
uiodttl=0; * Counter for total number of months received the problematic
amounts;
samemth=0; * Dummy indicator for spells starting and ending in the same
months;
******************************************************************************************************
** Define the start date and end dates. If R reports still receiving, then
use DCI as the **
** temporary end date for the last loop reported. In the next survey round,
R will be asked if he **
** or she is still receiving. If not, then a permanent end date equivalent
to the interview date **
** of the last round will be assigned. 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=err_or in data due to round 8 questionnaire problems or inconsistent
response. **
** Both results in our not sure whether Rs received in these months or not.
**
** QUESTIONNAIRE ERR_OR: These Rs reported valid start and stop dates but
were never **
** asked the follow-up question - if they received again. **
** CONFLICTING RESPONSE: These Rs reported 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 answered NO. **
******************************************************************************************************;
**** Create start and stop dates of welfare spells - format yyyymm;
** The start and or end days are missing. So we have to make some
assumptions about them. We assume
the start day to be the 1st of the month and the end day to be the last day
of the month.;
do p=1 to dim(csm);
if -4<es(p)<0 then do;
dataprb1=1;
handedit=handedit+1;
sdy(p)=28;
end;
if -4<ee(p)<0 then do;
if dataprb1=0 then dataprb1=2;
if dataprb1=1 then dataprb1=3;
handedit=handedit+1;
edy(p)=28;
end;
end;
do p=1 to dim(csm); /** [B1] **/
*** (1) Set start date if both start month and 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.;
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 receiving now.;
if cur(p)=1 then do;
yme(p)=iym;
edy(p)=intd;
end;
** Set end date if both end month and 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;
* end day unknown, estimate 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 months from estimated weeks 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 month is unknown.;
if ys(p)>0 and -3<=ms(p)<=-1 then do;
** If weeks are known and currently receiving, then count backwards by the
number of weeks from
DCI. If the number of weeks falls short of the start year, the start month
is December of
that year. If the number of 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;
** 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) th