/*This is the latest Round */ /****************************HOUSEHOLD INCOME*************************************/ /** **/ /** File name: r19incom.sas **/ /** **/ /** VARIABLES IN GATOR VARIABLES IN THIS PROGRAM **/ /** ----------------- ---------------------------- **/ /** CV_INCOME_FAMILY TOP_GROSHHIY **/ /** CV_HH_POV_RATIO TOP_POVTHR **/ /** **/ /** This program creates two variables, top_grohhIY and top_povthr. Both are **/ /** top-coded by the means of top 2%. The rule for top-coding is: **/ /** 1. The variable is above top 2%; **/ /** 2. The other variable is top-coded, which means as long as one is **/ /** top-coded, the other one must be top-coded. **/ /*********************************************************************************/ /*************************************************************************************** VARIABLES IN the Gator VARIABLES USED IN THIS PROGRAM YINC-10400 YI_10400 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-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-4600 YI_4600 YINC-4700 YI_4700 YINC-4800 YI_4800 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.18 UI_AMT 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=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; if YI_7601=1 & YI_7602~=1 then othinc=-3; if YI_5000>=0 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 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 19. ***; ***************************************************************;*/ 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 *** Poverty Thresholds 2018 Poverty Thresholds for 2018 by Size of Family and Number of Related Children Under 18 Years Size of Family Unit Related children under 18 years None One Two Three Four Five Six Seven Eight or more One person (unrelated individual) Under 65 years 13,064 65 years and over 12,043 Two people....................... Householder under 65 years 16,815 17,308 Householder 65 years and over 15,178 17,242 Three people 19,642 20,212 20,231 Four people 25,900 26,324 25,465 25,554 Five people 31,234 31,689 30,718 29,967 29,509 Six people 35,925 36,068 35,324 34,612 33,553 32,925 Seven people 41,336 41,594 40,705 40,085 38,929 37,581 36,102 Eight people 46,231 46,640 45,800 45,064 44,021 42,696 41,317 40,967 Nine people or more 55,613 55,883 55,140 54,516 53,491 52,082 50,807 50,491 48,546 ***********************************************************************************************************************************/ 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= 13064; end; else if hhsize=2 then do; if under18=0 then povert= 16815; else if under18=1 then povert= 17308; end; else if hhsize=3 then do; if under18=0 then povert= 19642; else if under18=1 then povert= 20212; else if under18=2 then povert= 20231; end; else if hhsize=4 then do; if under18=0 then povert= 25900; else if under18=1 then povert= 26324; else if under18=2 then povert= 25465; else if under18=3 then povert= 25554; end; else if hhsize=5 then do; if under18=0 then povert= 31234; else if under18=1 then povert= 31689; else if under18=2 then povert= 30718; else if under18=3 then povert= 29967; else if under18=4 then povert= 29509; end; else if hhsize=6 then do; if under18=0 then povert= 35925; else if under18=1 then povert= 36068; else if under18=2 then povert= 35324; else if under18=3 then povert= 34612; else if under18=4 then povert= 33553; else if under18=5 then povert= 32925; end; else if hhsize=7 then do; if under18=0 then povert= 41336; else if under18=1 then povert= 41594; else if under18=2 then povert= 40705; else if under18=3 then povert= 40085; else if under18=4 then povert= 38929; else if under18=5 then povert= 37581; else if under18=6 then povert= 36102; end; else if hhsize=8 then do; if under18=0 then povert= 46231; else if under18=1 then povert= 46640; else if under18=2 then povert= 45800; else if under18=3 then povert= 45064; else if under18=4 then povert= 44021; else if under18=5 then povert= 42696; else if under18=6 then povert= 41317; else if under18=7 then povert= 40967; end; else if hhsize>=9 then do; if under18=0 then povert= 55613; else if under18=1 then povert= 55883; else if under18=2 then povert= 55140; else if under18=3 then povert= 54516; else if under18=4 then povert= 53491; else if under18=5 then povert= 52082; else if under18=6 then povert= 50807; else if under18=7 then povert= 50491; else if under18=8 then povert= 48546; else if under18>=9 then povert= 48546; 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); 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; if groshhIY=-4 then do; povthr=-4; vskpPOV=1; end; 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; groshhIY_notop=groshhIY; povthr_notop=povthr; /*******************************; ****** THIS IS THE END OF INCOME-POVERTY RATIO. *****; ******************************************************************************; ********************* top-coding *********************************************; *NOTE: The first step below calculates the 98th percentile for both groshhIY and poverthr(topcode_GIY, topcode_POV). RUN THE PROGRAM TO THIS STEP AND STOP. Plug these threshholds in to get values in the top 2% (over_gross, over_pov). Once the values in the top 2% have been identified, the next step is to find the mean of those values (mean_topcode_GIY, mean_topcode_POV). RUN THE PROGRAM TO THIS STEP AND STOP. The numerical values used to to topcode have to be inserted in the final step where the output will be generated.; *finds 98% for groshhIY and povthr when a reported amount is present, i.e. ge 0 (topcode_GIY, topcode_POV); ******************************************************************************; ****** THIS IS THE END OF INCOME-POVERTY RATIO. *****; ******************************************************************************; ****************** Top Coding *************************;*/ proc capability data=one noprint pctldef=3; where nonintGIY=. & invskpGIY=.; var groshhIY; output out=GIY1 pctlpts=98 pctlpre=top_GIY; run; proc capability data=one noprint pctldef=3; where nonintPOV=. & invskpPOV=. & vskpPOV=.; var povthr; output out=POV1 pctlpts=98 pctlpre=top_POV; run; data one; set one; if _n_=1 then set GIY1; run; data one; set one; if _n_=1 then set POV1; run; proc means data=one noprint; where groshhIY>=top_GIY98; var groshhIY; output out=GIY2 mean=mean_top_GIY98; run; proc means data=one noprint; where povthr>=top_POV98; var povthr; output out=POV2 mean=mean_top_POV98; run; data one; set one; if _n_=1 then set GIY2; drop _type_ _freq_; run; data one; set one; if _n_=1 then set POV2; drop _type_ _freq_; run; data one; set one; if groshhIY>=top_GIY98 then do; top_groshhIY=round(mean_top_GIY98,1); topGIY=1; end; else do; top_groshhIY=groshhIY; topGIY=0; end; if povthr>=top_POV98 then do; top_povthr=round(mean_top_POV98,1); topPOV=1; end; else do; top_povthr=povthr; topPOV=0; end; run; data one; set one; chk1=0; chk2=0; if topGIY=1 and topPOV=0 then chk1=1; if topPOV=1 and topGIY=0 then chk2=1; proc freq;table chk:; run; data one; set one; if chk1=1 then do; top_povthr=round(mean_top_POV98,1); topPOV=2; end; if chk2=1 then do; top_groshhIY=round(mean_top_GIY98,1); topGIY=2; end; if topGIY>0 | topPOV>0 then do; groshhIY=top_groshhIY; povthr=top_povthr; end; run;