%let name=mc1a; filename odsout '.'; %let mc1path=\\l72586.na.sas.com\public\VAST_2011\MC_1_Materials_3-30-2011\; libname mydata "&mc1path"; /* Find microblog postings with certain keywords (later, plot them on the map) */ data matches; set mydata.microblogs; length symptom $10; flag=1; if index(text,' flu ')^=0 then do; symptom='flu'; output; end; if index(text,' fever')^=0 then do; symptom='fever'; output; end; if index(text,' chill')^=0 then do; symptom='chill'; output; end; if index(text,' sweat')^=0 then do; symptom='sweat'; output; end; if index(text,' ache')^=0 then do; symptom='ache'; output; end; if index(text,' pain')^=0 then do; symptom='pain'; output; end; if index(text,' fatigue')^=0 then do; symptom='fatigue'; output; end; if index(text,' cough')^=0 then do; symptom='cough'; output; end; if index(text,' breathing')^=0 then do; symptom='breathing'; output; end; if index(text,' nausea')^=0 then do; symptom='nausea'; output; end; if index(text,' vomit')^=0 then do; symptom='vomit'; output; end; if index(text,' diarrhea')^=0 then do; symptom='diarrhea'; output; end; run; data matches; set matches; symptom_html='title='||quote(trim(left(symptom))); run; goptions device=png; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title='IEEE VAST Challenge 2011 - mini-challenge 1') style=sasweb; goptions noborder; goptions cback=white; goptions gunit=pct htitle=16pt htext=11pt ftitle="arial/bold" ftext="arial"; legend1 across=1 label=none position=(right middle) order=descending shape=bar(.15in,.15in); goptions xpixels=800 ypixels=600; title1 ls=1.5 "Number of microblogs containing certain keywords..."; title2 "(flu, fever, chill, sweat, ache, pain, fatigue, cough, breathing, nausea, vomit, diarrhea)"; title3 "up to, and including, the outbreak"; footnote1 c=gray j=c "Note: Blogs with multiple keywords get counted multiple times"; axis1 label=none value=(angle=90) order=('30apr2011'd to '20may2011'd by day); axis2 order=(0 to 20000 by 5000) minor=none offset=(0,0); proc gchart data=matches; vbar date / discrete type=freq maxis=axis1 raxis=axis2 subgroup=symptom autoref cref=graydd clipref legend=legend1 html=symptom_html des='' name="&name"; run; title1 ls=1.5 "Number of microblogs containing certain keywords..."; title2 "(flu, fever, chill, sweat, ache, pain, fatigue, cough, breathing, nausea, vomit, diarrhea)"; title3 "in the days before the outbreak"; axis1 label=none value=(angle=90 t=19 'omitted' t=20 'omitted' t=21 'omitted') order=('30apr2011'd to '20may2011'd by day); axis2 minor=none offset=(0,0); proc gchart data=matches (where=(date<='17may2011'd)); vbar date / discrete type=freq maxis=axis1 raxis=axis2 subgroup=symptom autoref cref=graydd clipref legend=legend1 html=symptom_html des='' name="&name"; run; /* proc print data=matches (obs=100); run; */ quit; ODS HTML CLOSE; ODS LISTING;