/*This is the latest Round */ /****************************HOUSEHOLD INCOME*******************************************/ /** **/ /** File name: r21income.sas **/ /** **/ /** VARIABLES IN GATOR VARIABLES IN THIS PROGRAM **/ /** ----------------- ---------------------------- **/ /** CV_INCOME_FAMILY groshhIY_trunc **/ /** CV_HH_POV_RATIO povthr_trunc **/ /** **/ /** This program creates two variables, top_grohhIY and top_povthr. Both are **/ /** top-coded by the means of the updated procedures approved by BLS. The updated **/ /** procedures are based on top 2%, with high outliers trimmed. **/ /** **/ /** **/ /***************************************************************************************/ /*************************************************************************************** VARIABLES IN PUBLIC VARIABLES USED IN THIS PROGRAM DATA RELEASE YINC-11300B YI_11300B YINC-11600B YI_11600B YINC-11700 YI_11700 YINC-1400 YI_1400 YINC-1600 YI_1600 YINC-1700 YI_1700 YINC-1800 YI_1800 YINC-2000 YI_2000 YINC-2100 YI_2100 YINC-2200 YI_2200 YINC-2250 YI_2250 YINC-2260 YI_2260 YINC-2270 YI_2270 YINC-2350 YI_2350 YINC-2400 YI_2400 YINC-2500 YI_2500 YINC-2600 YI_2600 YINC-2700 YI_2700 YINC-2900 YI_2900 YINC-3000 YI_3000 YINC-3100 YI_3100 YINC-3150 YI_3150 YINC-3160 YI_3160 YINC-3170 YI_3170 YINC-3300 YI_3300 YINC-3900 YI_3900 YINC-4000 YI_4000 YINC-4100 YI_4100 YINC-4200 YI_4200 YINC-4300 YI_4300 YINC-4400 YI_4400 YINC-4500 YI_4500 YINC-4900 YI_4900 YINC-5000 YI_5000 YINC-5100 YI_5100 YINC-5200 YI_5200 YINC-5300 YI_5300 YINC-5400 YI_5400 YINC-5700A YI_5700A YINC-5900A YI_5900A YINC-6000A YI_6000A YINC-6100A YI_6100A YINC-6200A YI_6200A YINC-6300A YI_6300A YINC-6400A YI_6400A YINC-6500A YI_6500A YINC-7600 YI_7600 YINC-7700 YI_7700 YINC-7800 YI_7800 CVC_AMT_UI_YR.22 UI_AMT_22 CV_HH_SIZE hhsize CV_HH_UNDER_18 under18; ****************************************************************************************/ SAS Code for Variable Creation /******************************************; ***********income from non-farm employment, nfarmY*****************; *******************************************************************;*/ nfarmY=-4; if YI_1400=1 or ((YI_1400 in (-1,-2,-3)) and (YI_1600 eq 1)) then do; if YI_1700 >= 0 then nfarmY=YI_1700; else if YI_1700 in (-1,-2,-3) then do; if YI_1800 eq 1 then nfarmY=2500; else if YI_1800 = 2 then nfarmY=7500; else if YI_1800 = 3 then nfarmY=17500; else if YI_1800 = 4 then nfarmY=37500; else if YI_1800 = 5 then nfarmY=75000; else if YI_1800 = 6 then nfarmY=175000; else if YI_1800 = 7 then nfarmY=250001; 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; if YI_2100 not in(-1, -2, -3) then farmY=YI_2100; else if YI_2100 in (-1,-2,-3) then do; if YI_2200=1 then farmY=-2; else if YI_2200=2 then farmY=2500; else if YI_2200=3 then farmY=7500; else if YI_2200=4 then farmY=17500; else if YI_2200=5 then farmY=37500; else if YI_2200=6 then farmY=75000; else if YI_2200=7 then farmY=175000; else if YI_2200=8 then farmY=250001; 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; if YI_2260 not in(-1, -2, -3) then wcompY=YI_2260; if YI_2260 in (-1,-2,-3) then do; if YI_2270=1 then wcompY=500; else if YI_2270=2 then wcompY=1750; else if YI_2270=3 then wcompY=3750; else if YI_2270=4 then wcompY=7500; else if YI_2270=5 then wcompY=17500; else if YI_2270=6 then wcompY=37500; else if YI_2270=7 then wcompY=50001; 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_2350=1 & (YI_2400=1 or (YI_2400 in (-1) & YI_2500=1)) then do; if YI_2600>=0 then nfarmP=YI_2600; if YI_2600 in (-1,-2,-3) then do; if YI_2700=1 then nfarmP=2500; else if YI_2700=2 then nfarmP=7500; else if YI_2700=3 then nfarmP=17500; else if YI_2700=4 then nfarmP=37500; else if YI_2700=5 then nfarmP=75000; else if YI_2700=6 then nfarmP=175000; else if YI_2700=7 then nfarmP=250001; end; end; if YI_2350=-1 or YI_2500=-1 or YI_2700=-1 then nfarmP=-1; if YI_2350=-2 or YI_2400=-2 or YI_2500=-2 or YI_2700=-2 then nfarmP=-2; if YI_2350=-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_2350=1 & YI_2900=1 then do; if YI_3000 not in (-1, -2, -3) then farmP=YI_3000; if YI_3000 in (-1,-2,-3) then do; if YI_3100=1 then farmP=-2; else if YI_3100=2 then farmP=2500; else if YI_3100=3 then farmP=7500; else if YI_3100=4 then farmP=17500; else if YI_3100=5 then farmP=37500; else if YI_3100=6 then farmP=75000; else if YI_3100=7 then farmP=175000; else if YI_3100=8 then farmP=250001; end; end; if YI_2350=-1 or YI_2900=-1 or YI_3100=-1 then farmP=-1; else if YI_2350=-2 or YI_2900=-2 or YI_3100=-2 then farmP=-2; else if YI_2350=-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_2350=1 & YI_3150=1 then do; if YI_3160>=0 then wcompP=YI_3160; if YI_3160 in (-1,-2,-3) then do; if YI_3170=1 then wcompP=500; else if YI_3170=2 then wcompP=1750; else if YI_3170=3 then wcompP=3750; else if YI_3170=4 then wcompP=7500; else if YI_3170=5 then wcompP=17500; else if YI_3170=6 then wcompP=37500; else if YI_3170=7 then wcompP=50001; end; end; if YI_2350=-1 or YI_3150=-1 or YI_3170=-1 then wcompP=-1; else if YI_2350=-1 or YI_3150=-2 or YI_3170=-2 then wcompP=-2; else if YI_2350=-1 or YI_3150=-3 or YI_3170=-3 then wcompP=-3; problem1=0; problem2=0; if YI_2350 in (0, -1, -2) & (problem1a=1 | problem1b=1) then do; nfarmP=-3; problem1=1; end; if YI_2350 in( 1,-1,-2) & (problem2a=1 | problem2b=1) then do; wcompP=-4; farmP=-4; nfarmP=-4; problem2=1; end; /**************************************************************************************; *** Child support payment received by respondent or his/her partner/spouse - chsup****; **************************************************************************************;*/ chsup=-4; if YI_3300=1 & YI_3900=1 then do; if YI_4000=1 & YI_4100>=0 then chsup=YI_4100; if YI_4000=1 & YI_4100 in (-1,-2,-3) then do; if YI_4200=1 then chsup=500; else if YI_4200=2 then chsup=1750; else if YI_4200=3 then chsup=3750; else if YI_4200=4 then chsup=7500; else if YI_4200=5 then chsup=17500; else if YI_4200=6 then chsup=37500; else if YI_4200=7 then chsup=50001; end; end; if YI_3300=-1 or YI_3900=-1 or YI_4000=-1 or YI_4200=-1 then chsup=-1; else if YI_3300=-2 or YI_3900=-2 or YI_4000=-2 or YI_4200=-2 then chsup=-2; else if YI_3300=-3 or YI_3900=-3 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; if YI_4400>=0 then intrst=YI_4400; if YI_4400 in (-1,-2,-3) then do; if YI_4500=1 then intrst=250; else if YI_4500=2 then intrst=750; else if YI_4500=3 then intrst=1750; else if YI_4500=4 then intrst=3750; else if YI_4500=5 then intrst=6250; else if YI_4500=6 then intrst=8750; else if YI_4500=7 then intrst=10001; 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.******************************; ************************************************************************************; *** Rental income received by the respondent and his/her partner/spouse - rntinc ***; ************************************************************************************;*/ rntinc=-4; if YI_4900=1 then do; if YI_5000>=0 then rntinc=YI_5000; if YI_5000 in (-1,-2,-3) then do; if YI_5100=1 then rntinc=500; else if YI_5100=2 then rntinc=1750; else if YI_5100=3 then rntinc=3750; else if YI_5100=4 then rntinc=7500; else if YI_5100=5 then rntinc=17500; else if YI_5100=6 then rntinc=37500; else if YI_5100=7 then rntinc=50001; 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. *************************; ***********************************************************************************; *** 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;*R19: YI_7600 was divided into YI7601 and YI7602; if YI_7602=1 | YI_7602 in (-1,-2) then do; if YI_7700>=0 then othinc=YI_7700; if YI_7700 in (-1,-2,-3) then do; 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_7800=-1 then othinc=-1; else if YI_7800=-2 then othinc=-2; else if YI_7800=-3 then othinc=-3; /**********************************************************************/ /**** Income from other family members living with R: othfaminc ***/ /**********************************************************************/ othfaminc=-4; if YI_11600B>=0 then do; othfaminc=YI_11600B; end; if YI_11600B in (-1,-2,-3) then do; 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; /*************************************************************************************; *** Compute the respondent's gross household income in the past year (groshhIY). ***; ************************************************************************************/ if UI_spouse=0 then UI_spouse =-4; array varsY (*) nfarmY farmY wcompY nfarmP farmP wcompP chsup intrst rntinc othinc othfaminc UI_AMT_22 UI_spouse; groshhIY=0; do i=1 to dim(varsY); if varsY(i) not in (-1,-2,-3,-4, .) then groshhIY=groshhIY+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 20. *** *****************************************************************/; if YI_1400=-5 then do; groshhIY=-5; nonintGIY=1; end; /****************************************************************; ***** THIS IS THE END OF INCOME *****; *****************************************************************; **********************************************************************************; **********************************************************************************; ************ start of the income-poverty ratio section (povthr) ******************; **********************************************************************************; *** Create the poverty thresholds taken from u.s.census' website ***; *** https://www.census.gov/data/tables/time-series/demo/income-poverty/historical-poverty-thresholds.html *** povert=-4; if hhsize=-1 or under18=-1 then povert=-1; if hhsize=-2 or under18=-2 then povert=-2; if hhsize=-3 or under18=-3 then povert=-3; /*** Check if there are only children under 18 in the household - check these cases again.;*/ only_under18_HH=0; if hhsize>0 & under18>0 & hhsize=under18 then only_under18_HH=1; if hhsize=1 then do; if under18=0 then povert= 15225; end; else if hhsize=2 then do; if under18=0 then povert= 19597; else if under18=1 then povert= 20172; end; else if hhsize=3 then do; if under18=0 then povert= 22892; else if under18=1 then povert= 23556; else if under18=2 then povert= 23578; end; else if hhsize=4 then do; if under18=0 then povert= 30186; else if under18=1 then povert= 30679; else if under18=2 then povert= 29678; else if under18=3 then povert= 29782; end; else if hhsize=5 then do; if under18=0 then povert= 36402; else if under18=1 then povert= 36932; else if under18=2 then povert= 35801; else if under18=3 then povert= 34926; else if under18=4 then povert= 34391; end; else if hhsize=6 then do; if under18=0 then povert= 41869; else if under18=1 then povert= 42035; else if under18=2 then povert= 41169; else if under18=3 then povert= 40339; else if under18=4 then povert= 39104; else if under18=5 then povert= 38373; end; else if hhsize=7 then do; if under18=0 then povert= 48176; else if under18=1 then povert= 48477; else if under18=2 then povert= 47440; else if under18=3 then povert= 46717; else if under18=4 then povert= 45371; else if under18=5 then povert= 43800; else if under18=6 then povert= 42076; end; else if hhsize=8 then do; if under18=0 then povert= 54881; else if under18=1 then povert= 54357; else if under18=2 then povert= 53378; else if under18=3 then povert= 52521; else if under18=4 then povert= 51304; else if under18=5 then povert= 49760; else if under18=6 then povert= 48153; else if under18=7 then povert= 47745; end; else if hhsize>=9 then do; if under18=0 then povert= 64815; else if under18=1 then povert= 65129; else if under18=2 then povert= 64263; else if under18=3 then povert= 63536; else if under18=4 then povert= 62342; else if under18=5 then povert= 60699; else if under18=6 then povert= 59213; else if under18=7 then povert= 58845; else if under18=8 then povert= 56578; else if under18>=9 then povert= 56578; end; /****** this is the end of hoursehold. ******; *******************************************************************************; *** 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 21;*/ 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; /*******************************; ****** THIS IS THE END OF INCOME-POVERTY RATIO. *****; ******************************************************************************; */ /**************************************************************************** Topcoding procedure, based on topcoding top 2% with outliers treated as well *****************************************************************************/ /* rename topcoded variables to names in public data release */ rename groshhIY_trunc=CV_INCOME_FAMILY povthr_trunc=CV_HH_POV_RATIO; endsas;