x cd /pub/data/saipe/Tools; %let pgm=pov2013mo; filename pgm "&pgm..sas" ; *---Create series of reports, charts and maps showing Missouri county poverty data per 2013 SAIPE data. jgb, 1-8-15. (originally developed has hltest.sas when it was just a test setup). ---*; %let htmlpdf=html; *--value can be either pdf or html, controlling the ods output destination---; *--if pdf is wanted then you must also comment out the ods html stmt below and uncomment the ods pdf stmt-; libname saipe '/pub/data/saipe'; libname sasmaps '/pub/sasmaps'; *---our gmap data sets (not the ones that come directly from SAS I) ---; %let outpath=%str(/pub/data/saipe/pov2013mo); libname temp '/SAS_temp'; /*<=========================Comment out===================================== data rankin temp.state; set saipe.mostcnty2013 (rename=(state=astate county=acounty)); length State County 4; State=Astate; County=substr(Acounty,3,3); *--to make it match with the gmap data set--; length hlink $120; hlink="TITLE='"||trim(areaname) || ": PctPoor=" ||Put(pctpoor,5.1) ||" ' " || "HREF='https://mcdc.missouri.edu/applications/applinks/links.php?g=05000US"||acounty||"'"; ***" HREF='https://mcdc.missouri.edu/applications/applinks/links.php?g=05000US"||acounty||"&n="||trim(areaname); ***hlink=trim(hlink)||"&p="||put(pctpoor,5.1)||"'"; if sumlev='040' then do; acounty='29000'; output temp.state; end; else output rankin; drop ciw: ; run; proc rank data=rankin out=temp.rankout ties=low descending; var pctpoor medianhhinc ; ranks pctpoor_rank medianhhinc_rank; run; ===========================End commented out================================ */ goptions reset=global; title h=1 "Poverty in Missouri Counties"; footnote c=black h=.5 "Source: 2013 Vintage SAIPE Estimates"; footnote2 c=black h=.5 "From setup in saipe/Tools/&pgm..sas"; goptions device=jpeg fontres=presentation; ***goptions ftext=swissb transparency noninterlaced htitle=1.2 ctitle=navy ; goptions ftext='Albany AMT/bold' transparency noninterlaced htitle=1.0 ctitle=navy ; ods html body="charts.&htmlpdf" (title="Pov in MO 2013 SAIPE") contents="contents.&htmlpdf" gpath="&outpath" path="&outpath" style=sasweb; ***ods pdf body="&outpath/charts.&htmlpdf" style=sasweb; ods listing close; options nodate; proc sort data=temp.rankout out=ranked; by pctpoor_rank; run; title2 h=1.5 "Report: Poorest Counties in Rank Order"; proc print label data=ranked; where pctpoor_rank le 12; id geocode areaname; var poor pctPoor PctPoor_rank; run; title2 "Bar Chart of Poorest Counties"; pattern1 c=blue; data chartdata; set temp.rankout temp.state; proc gchart data=chartdata ; *by &chartby; format acounty $mocnty.; where pctpoor_rank le 12; hbar acounty / sumvar=pctpoor discrete cframe=lightblue sumlabel="% Poor" frame description='Bar Chart of Poorest Counties' html=hlink; label acounty='County/State'; * label perno='Period' county='County/State' demographic='Pop Category'; run; proc format; value rankgrp 1-4='1 to 4' 5-8='5 to 8' 9-12='9 to 12'; ** 13-high='Not in Top 12'; run; proc gmap map=sasmaps.mocounties data=temp.rankout (where=(pctpoor_rank le 12)) all ; id state county; title2 "Missouri Counties Showing Twelve Poorest"; choro pctpoor_rank /discrete cempty=black cdefault=white html=hlink description='MO County Map Showing 12 Poorest Counties'; format pctpoor_rank rankgrp.; pattern1 c=navy; pattern2 c=lightblue; pattern3 c=blue value=m4x45; run; proc gmap map=sasmaps.mocounties data=temp.rankout; pattern1 c=white; pattern2 c=lightgray; ; pattern3 color=blue value=m3n45; pattern4 color=blue value=m3x45; pattern5 color=blue; id state county; title2 "All Missouri Counties Showing Percent Poor (Quintiles)"; choro pctpoor /levels=5 cempty=black cdefault=gray html=hlink description="Map of All MO Counties Showing % Poor (Quintiles)"; format pctpoor_rank rankgrp.; run; ods &htmlpdf close; ods listing;