<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: A SAS ODS Graphics &amp;quot;remix&amp;quot; of Edward Tufte's cancer survival slopegraph in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/A-SAS-ODS-Graphics-quot-remix-quot-of-Edward-Tufte-s-cancer/m-p/465345#M16035</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3slopegraphs.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20796i68D2BFEE81CF5EA1/image-size/large?v=v2&amp;amp;px=999" role="button" title="3slopegraphs.JPG" alt="3slopegraphs.JPG" /&gt;&lt;/span&gt;&lt;BR /&gt;Comparison of the output from the R (&lt;A href="https://ibecav.github.io/slopegraph/" target="_self"&gt;code&lt;/A&gt;), Python (&lt;A href="https://github.com/pascal-schetelat/Slope/blob/master/plotSlope.py" target="_self"&gt;code&lt;/A&gt;), and SAS (code above) based solutions&amp;nbsp;discussed above.&lt;/P&gt;</description>
    <pubDate>Sun, 27 May 2018 17:10:47 GMT</pubDate>
    <dc:creator>tc</dc:creator>
    <dc:date>2018-05-27T17:10:47Z</dc:date>
    <item>
      <title>A SAS ODS Graphics "remix" of Edward Tufte's cancer survival slopegraph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/A-SAS-ODS-Graphics-quot-remix-quot-of-Edward-Tufte-s-cancer/m-p/465280#M16032</link>
      <description>&lt;P&gt;After reading &lt;A href="https://www.r-bloggers.com/slopegraphs-and-r-a-pleasant-diversion-may-26-2018/" target="_self"&gt;Chuck Powell's interesting Slopegraphs and #R – A pleasant diversion&lt;/A&gt;, which graced the front page of R-bloggers.com recently, well, I just had to see if SAS ODS Graphics was also up to the challenge of creating a similar remix of &lt;A href="https://twitter.com/edwardtufte" target="_self"&gt;Edward Tufte&lt;/A&gt;'s famous &lt;A href="https://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0000Jr" target="_self"&gt;cancer survival rate slopegraph&lt;/A&gt;. Grabbed some data from &lt;A href="https://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0003nk" target="_self"&gt;ET contest winner&lt;/A&gt; Pascal Schetelat's GitHub &lt;A href="https://github.com/pascal-schetelat/Slope" target="_self"&gt;Python-based ET slopegraph project&lt;/A&gt;, wrote the short SAS program below, and voila! Was able to tap&amp;nbsp;into ODS Graphics'&amp;nbsp;"curvelabel" options&amp;nbsp;here to auto-magically prevent label collisions. Btw, if you're unfamiliar with health study data (like me!), be sure to read the &lt;A href="https://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0000Jr" target="_self"&gt;ET discussion group thread&lt;/A&gt;, which explains things like how survival rates can tick up over time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;OUTPUT&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SlopeGraph.png" style="width: 388px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20790i887F62E80BF7FCB4/image-size/large?v=v2&amp;amp;px=999" role="button" title="SlopeGraph.png" alt="SlopeGraph.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;CODE&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*==&amp;gt; A SAS ODS Graphics "Remix" of Edward Tufte's Famous Cancer Survival Slopegraph;
     
proc import datafile="/folders/myfolders/cancer_survival_rate.csv" dbms=csv out=rates replace; getnames=yes; guessingrows=max; /* Data is .csv */

proc sql;                       /* Use a little SQL to reshape the data from wide -&amp;gt; long for slopegraph */
create table rates2chart as 
select cancer_type,  5 as year, _5_year  as rate from rates union all
select cancer_type, 10 as year, _10_year as rate from rates union all
select cancer_type, 15 as year, _15_year as rate from rates union all
select cancer_type, 20 as year, _20_year as rate from rates;

ods graphics / width=11in height=17in antialias;  /* Create 11"x17" slopegraph using SERIES (lines) and TEXT (rate values) plot statements */
proc sgplot data=rates2chart noautolegend noborder; 
title height=12pt "Estimates of relative survival rates, by cancer site";  /* Repeat SERIES statement twice to get labels at beginning and end of series lines */
series x=year y=rate / group=cancer_type curvelabelpos=min curvelabel curvelabelloc=outside curvelabelattrs=(size=8pt color=black weight=bold) lineattrs=(pattern=solid thickness=1.5pt);
series x=year y=rate / group=cancer_type curvelabelpos=max curvelabel curvelabelloc=outside curvelabelattrs=(size=8pt color=black weight=bold) lineattrs=(pattern=solid thickness=1.5pt);
text x=year y=rate text=rate / strip textattrs=(size=8pt color=black weight=bold) backlight=0 backfill fillattrs=(color=white);  /* Create whitespace surrounding rates */
text x=year y=rate text=rate / strip textattrs=(size=8pt color=black weight=bold);  /* Repeat a second time without backfill to ensure rates aren't obscured by whitespace */
xaxis display=none type=discrete; yaxis display=none; /* Look Ma, no axes! */
refline 5 10 15 20 / axis=x label=('5 year' '10 year' '15 year' '20 year') labelattrs=(size=8pt color=black weight=bold) lineattrs=(thickness=0pt) labelloc=outside; /* Headings */
footnote height=8pt italic "Based on Edward Tufte discussion group thread at https://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0000Jr"; /* Credit (ideas) */
footnote2 height=8pt italic "Data sourced from https://github.com/pascal-schetelat/Slope"; /* Credit (data) */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;Cancer type,5 year,10 year,15 year,20 year
Prostate,99,95,87,81
Thyroid,96,96,94,95
Testis,95,94,91,88
Melanomas,89,87,84,83
Breast,86,78,71,65
Hodgkin's disease,85,80,74,67
"Corpus uteri, uterus",84,83,81,79
"Urinary, bladder",82,76,70,68
"Cervix, uteri",71,64,63,60
Larynx,69,57,46,38
Rectum,63,55,52,49
"Kidney, renal pelvis",62,54,50,47
Colon,62,55,54,52
Non-Hodgkin's,58,46,38,34
"Oral cavity, pharynx",57,44,38,33
Ovary,55,49,50,50
Leukemia,43,32,30,26
"Brain, nervous system",32,29,28,26
Multiple myeloma,30,13,7,5
Stomach,24,19,19,15
Lung and bronchus,15,11,8,6
Esophagus,14,8,8,5
"Liver, bile duct",8,6,6,8
Pancreas,4,3,3,3&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 May 2018 19:00:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/A-SAS-ODS-Graphics-quot-remix-quot-of-Edward-Tufte-s-cancer/m-p/465280#M16032</guid>
      <dc:creator>tc</dc:creator>
      <dc:date>2018-05-26T19:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: A SAS ODS Graphics "remix" of Edward Tufte's cancer survival slopegraph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/A-SAS-ODS-Graphics-quot-remix-quot-of-Edward-Tufte-s-cancer/m-p/465290#M16033</link>
      <description>&lt;P&gt;Excellent example&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4628"&gt;@tc&lt;/a&gt;!&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13856"&gt;@Jay54&lt;/a&gt;&amp;nbsp;should print this out and hang it on his wall.&amp;nbsp; He must have quite a gallery by now.&lt;/P&gt;</description>
      <pubDate>Sat, 26 May 2018 21:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/A-SAS-ODS-Graphics-quot-remix-quot-of-Edward-Tufte-s-cancer/m-p/465290#M16033</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-05-26T21:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: A SAS ODS Graphics "remix" of Edward Tufte's cancer survival slopegraph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/A-SAS-ODS-Graphics-quot-remix-quot-of-Edward-Tufte-s-cancer/m-p/465299#M16034</link>
      <description>&lt;P&gt;Really nice graph,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4628"&gt;@tc&lt;/a&gt;!&lt;/P&gt;</description>
      <pubDate>Sun, 27 May 2018 02:16:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/A-SAS-ODS-Graphics-quot-remix-quot-of-Edward-Tufte-s-cancer/m-p/465299#M16034</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2018-05-27T02:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: A SAS ODS Graphics "remix" of Edward Tufte's cancer survival slopegraph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/A-SAS-ODS-Graphics-quot-remix-quot-of-Edward-Tufte-s-cancer/m-p/465345#M16035</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3slopegraphs.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20796i68D2BFEE81CF5EA1/image-size/large?v=v2&amp;amp;px=999" role="button" title="3slopegraphs.JPG" alt="3slopegraphs.JPG" /&gt;&lt;/span&gt;&lt;BR /&gt;Comparison of the output from the R (&lt;A href="https://ibecav.github.io/slopegraph/" target="_self"&gt;code&lt;/A&gt;), Python (&lt;A href="https://github.com/pascal-schetelat/Slope/blob/master/plotSlope.py" target="_self"&gt;code&lt;/A&gt;), and SAS (code above) based solutions&amp;nbsp;discussed above.&lt;/P&gt;</description>
      <pubDate>Sun, 27 May 2018 17:10:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/A-SAS-ODS-Graphics-quot-remix-quot-of-Edward-Tufte-s-cancer/m-p/465345#M16035</guid>
      <dc:creator>tc</dc:creator>
      <dc:date>2018-05-27T17:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: A SAS ODS Graphics "remix" of Edward Tufte's cancer survival slopegraph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/A-SAS-ODS-Graphics-quot-remix-quot-of-Edward-Tufte-s-cancer/m-p/487035#M16773</link>
      <description>&lt;P&gt;Thanks for the slopegraph code! I "borrowed" it for a project.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 15:23:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/A-SAS-ODS-Graphics-quot-remix-quot-of-Edward-Tufte-s-cancer/m-p/487035#M16773</guid>
      <dc:creator>AndrewZ</dc:creator>
      <dc:date>2018-08-15T15:23:18Z</dc:date>
    </item>
  </channel>
</rss>

