x cd /mscdc/data/saipe/Tools; %let pgm=saipe93.cnvt; filename pgm "&pgm..sas"; *--Read downloaded (from Bureau FTP server in /pub/housing/saipe directory, 4-9-97 circa *:00 a.m. cdt) income and poverty estimates data for u.s. counties--; ********Numbers were revised by the bureau in Jan 1998 and we are rerunning the conversions in March of 1998 (jgb, 3-20-98)--; filename cntyin '/mscdc/data/saipe/est93ALL.dat'; *filename statein '/mscdc/data/saipe/est93US.dat'; ***Apparently not used!***; libname saipe '/mscdc/data/saipe'; title 'saipe93.cnvt: Convert Income and Poverty Estimates Data for US ' 'States and Counties'; title2 '*** Run of March 1998 Using Data Revised by BOC January 1998 ***'; *options nocenter; options ls=157 ps=60; data saipes; retain year '1993'; *<--data for income year of 93 but based on 94 residents--; retain vers 'JAN98'; label vers='Version (Census Bureau Relase Date)'; length default=5; attrib slvl length=$3 format=$slvl. label='Geographic summary level' state length=$2 label='State FIPS code' stab length=$2 label='State Postal Abbrev' county length=$5 format=$5. cnty length=$3 label='County FIPS code' areaname length=$40 poor label='Total Persons Below Poverty' poorstd2 label='Width of 90% conf interval for poor' povuniv label='Persons for who pov status assigned' format=comma9. pctpoor length=4 format=f5.1 label= "% Poor, All Persons" pp1std2 label='Width 90% conf intvl %Poor All Persons' poor5_17 label='# of Poor related Children 5-17' p517std2 label='Width of 90% conf intrvl- poor 5-17' povu5_17 label='Pov Universe for 5-17 rel children' format=comma8. pctp5_17 label='% Poor, Children 5-17' format=f5.1 pp3std2 label='Width 90% conf intvl %Poor 5-17' medhhinc label='Median Household Income' format=dollar8. mhhistd2 label='Width of 90% conf intrval - Medhhinc'; attrib poor0_17 label='Poor Persons 0-17' p017std2 label='Width of 90% conf intrvl-poor 0-17' pctp0_17 label='% Poor, Persons 0-17' pp2std2 label='Width 90% conf intvl %Poor 0-17' povu0_17 label='Pov Universe for 0-17 Persons' ; /* Here is an extract cut and pasted from the "readme" file on the ftp site: 8- 15 Estimate of people of all ages in poverty 17- 24 90% confidence interval lower bound of estimate of people of all ages in poverty 26- 33 90% confidence interval upper bound of estimate of people of all ages in poverty 35- 38 Estimated percent of people of all ages in poverty 40- 43 90% confidence interval lower bound of estimate of percent of people of all ages in poverty 45- 48 90% confidence interval upper bound of estimate of percent of people of all ages in poverty 50- 57 Estimate of people age 0-17 in poverty 59- 66 90% confidence interval lower bound of estimate of people age 0-17 in poverty 68- 75 90% confidence interval upper bound of estimate of people age 0-17 in poverty 77- 80 Estimated percent of people age 0-17 in poverty 82- 85 90% confidence interval lower bound of estimate of percent of people age 0-17 in poverty 87- 90 90% confidence interval upper bound of estimate of percent of people age 0-17 in poverty 92- 99 Estimate of related children age 5-17 in families in poverty 101-108 90% confidence interval lower bound of estimate of related children age 5-17 in families in poverty 110-117 90% confidence interval upper bound of estimate of related children age 5-17 in families in poverty 119-122 Estimated percent of related children age 5-17 in families in poverty 124-127 90% confidence interval lower bound of estimate of percent of related children age 5-17 in families in poverty 129-132 90% confidence interval upper bound of estimate of percent of related children age 5-17 in families in poverty 134-139 Estimate of median household income 141-146 90% confidence interval lower bound of estimate of median household income 148-153 90% confidence interval upper bound of estimate of median household income NOTE: Columns 155-192 will be blank for all county-level records. These data are only available at the national and state-level. 155-161 Estimate of people under age 5 in poverty 163-169 90% confidence interval lower bound of estimate of people under age 5 in poverty 171-177 90% confidence interval upper bound of estimate of people under age 5 in poverty 179-182 Estimated percent of people under age 5 in poverty 184-187 90% confidence interval lower bound of estimate of percent of people under age 5 in poverty 189-192 90% confidence interval upper bound of estimate of percent of people under age 5 in poverty end of excerpt */ *--note: confidence interval variables with numeric suffixes (conflim1-conflim6) were on orginal (4/97) file. Those with alpha suffixes were new with the Jan 98 version of the data---*; infile cntyin ; input state $char2. +1 cnty $char3. poor 8-15 conflim1 17-24 conflim2 26-33 pctpoor 35-38 conflima 40-43 conflimb 45-48 poor0_17 50-57 conflimc 59-66 conflimd 68-75 pctp0_17 77-80 conflime 82-85 conflimf 87-90 poor5_17 92-99 conflim3 101-108 conflim4 110-117 pctp5_17 119-122 conflimg 124-127 conflimh 129-132 medhhinc 134-139 conflim5 141-146 conflim6 148-153 stab $240-241 ; *--we do NOT READ the under-5 estimates, available only at the state level-; state=translate(state,'0',' '); cnty=translate(cnty,'0',' '); if cnty gt '000' then do; slvl='050'; county=state||cnty; areaname=put(county,$county.); end; else if state gt '00' then slvl='040'; else slvl='010'; *<--state and us-; if slvl='040' then areaname=put(state,$state.); else if slvl='010' then areaname='United States'; if pctpoor then povuniv=poor*100/pctpoor; if pctp5_17 then povu5_17=100*poor5_17/pctp5_17; if pctp0_17 then povu0_17=100*poor0_17/pctp0_17; poorstd2=(conflim2-conflim1)*.5; p517std2=(conflim4-conflim3)*.5; mhhistd2=(conflim6-conflim5)*.5; pp1std2=(conflimb-conflima)*.5; p017std2=(conflimd-conflimc)*.5; pp2std2=(conflimf-conflime)*.5; pp3std2=(conflimh-conflimg)*.5; drop conflim1-conflim6 conflima conflimb conflimc conflimd conflime conflimf conflimg conflimh; *--save vars with 2 standard deviation width values--; length poorstd2--pp3std2 4; run; proc sort out=saipe.us93(label='County pov and Med HH income ests 93' index=(state)); by state county; run; proc sql; *<--create views--; create view saipe.usstates as select * from us93(drop=cnty county) where slvl='010' or slvl='040'; *<--US totals or state totals-; create view saipe.mo93 as select * from us93 where state='29'; create view saipe.il93 as select * from us93 where state='17'; create view saipe.ks93 as select * from us93 where state='20'; create view saipe.stlmil93 as select * from us93 where slvl='050' and state in ('29','17') and put(county,$cntymet.)='7040M'; quit; proc contents data=saipe.us93 directory; title3 'Contents Report'; run; proc print data=saipe.us93(obs=25); title3 'Sample Report - First 25 Obs of saipe.us93'; title3 'Has US Totals, State and County Summaries'; by year state stab; id cnty county areaname; run; proc print d data=saipe.stlmil93; title3 'saipe.stlmil93 (St. Louis Mo-IL 93) (View)'; by year state stab; run; ***metahtml(path=%str(/mscdc/data/saipe),setin=us93) run;