<?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: How to construct line graph of complication rate by BMI percent in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-construct-line-graph-of-complication-rate-by-BMI-percent/m-p/228313#M8274</link>
    <description>&lt;P&gt;Something like this (untested)?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
  do UTI    ='Y','N';
  do SEPSIS ='Y','N';
    do BMI = 0.05 to 0.95 by 0.05;
      NBCASES=round(ranuni(0)*100);
      output;
    end;
  end;
  end;
run;

proc sql;
 create table RATES as
   select BMI
        , sum(NBCASES*(UTI    ='Y'))          /sum(NBCASES) as RATE_UTI
        , sum(NBCASES*(SEPSIS ='Y'))          /sum(NBCASES) as RATE_SEPSIS
        , sum(NBCASES*(SEPSIS ='Y')*(UTI='Y'))/sum(NBCASES) as RATE_COMPLIC
  from HAVE
  group by BMI;
quit;

proc plot data=RATES;
  plot (RATE_UTI RATE_SEPSIS RATE_COMPLIC)*BMI / overlay ;
  format RATE: percent.;
  run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 03 Oct 2015 10:28:44 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2015-10-03T10:28:44Z</dc:date>
    <item>
      <title>How to construct line graph of complication rate by BMI percent</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-construct-line-graph-of-complication-rate-by-BMI-percent/m-p/227391#M8241</link>
      <description>&lt;P&gt;This seems like such a simple thing to do, yet I am not understanding how to do this and would appreciate some help. First, I have a dataset of 1000 patients. What I am trying to do is construct a line graph of the number of patients who have urinary tract infection (y-axis)&amp;nbsp;vs. BMI % (x-axis)&amp;nbsp;and number of patients who have sepsis (y-axis) vs. BMI %&amp;nbsp;(x-axis). The dataset has UTI (yes/no) and sepsis (yes/no) as well as a column for BMI percentage (I also have available&amp;nbsp;variables giving the number of occurrences of UTI and sepsis). What I want is the rate of sepsis by BMI % and the rate of UTI by BMI&amp;nbsp;%. I&amp;nbsp;also want to combine sepsis and UTI&amp;nbsp;and call it "complications" and then look at rate of complication&amp;nbsp;by BMI %.&amp;nbsp;How do I set up my data to do this and which&amp;nbsp;SAS code&amp;nbsp;can help me accomplish this? Like I said, this seems very simple to me, but for some reason I can't figure this out. Thanks in advance. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2015 14:40:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-construct-line-graph-of-complication-rate-by-BMI-percent/m-p/227391#M8241</guid>
      <dc:creator>anuli98</dc:creator>
      <dc:date>2015-09-26T14:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to construct line graph of complication rate by BMI percent</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-construct-line-graph-of-complication-rate-by-BMI-percent/m-p/227400#M8242</link>
      <description>I think you should simplify your question. Start with a single - clear - question and post sample data and what you'd like to see, a quick image mocked up in Excel or even hand drawn and attached would be helpful.&lt;BR /&gt;</description>
      <pubDate>Sat, 26 Sep 2015 18:49:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-construct-line-graph-of-complication-rate-by-BMI-percent/m-p/227400#M8242</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-09-26T18:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to construct line graph of complication rate by BMI percent</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-construct-line-graph-of-complication-rate-by-BMI-percent/m-p/227510#M8246</link>
      <description>&lt;P&gt;Also with any rate you want to consider your denominator. When you say BMI, since that is likely to be a continuous measure and depending on precision of measurement and calculation method could very well have no duplicates for a sample as small as 1000.&lt;/P&gt;&lt;P&gt;You may need to round your BMI into useable ranges of values that make sense for the project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And a first step would be to have your UTI and SEPSIS variables as numeric coded 1 for yes and 0 for no. Then when you take the MEAN of UTI or sepsis within any group the result is a percentage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2015 14:49:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-construct-line-graph-of-complication-rate-by-BMI-percent/m-p/227510#M8246</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-09-28T14:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to construct line graph of complication rate by BMI percent</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-construct-line-graph-of-complication-rate-by-BMI-percent/m-p/227747#M8250</link>
      <description>&lt;P&gt;Hi, here's an idea using GPLOT (someone else can do SGPLOT) ...&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* some fake data;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data x;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;do _n_=1 to 1000;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;uti = ifn(ranuni(99) lt 0.3, 1, 0); &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;sep = ifn(ranuni(99) lt 0.2, 1, 0);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;bmi = round(10 + (15*ranuni(99)));&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;output;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* calculate percent URI and SEP within BMI groups;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;proc summary data=x nway;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;class bmi;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;var uti sep;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;output out=mydata (drop=_:) mean=;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* rescale percentages (0 to 100);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data mydata;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;set mydata;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;uti = round(100*uti,.1);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;sep = round(100*sep,.1);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;comps = uti+sep;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* GPLOT (someone else can do SGPLOT);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;goptions reset=all ftext='calibri' htext=2 gunit=pct;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* choose some graphics options;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;symbol1 i=j f='wingdings' v='6c'x h=3 c=red w=3;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;symbol2 i=j f='wingdings' v='6e'x h=3 c=blue w=3;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;symbol3 i=j f='wingdings' v='ab'x h=3.5 c=green w=3;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;legend1 position=(top inside left) label=none offset=(3,)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;value=(j=c c=red 'UTI' c=blue 'SEP' c=green 'BOTH') shape=symbol(.0001,3);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;axis1 offset=(2,2)pct label=('BODY MASS INDEX');&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;axis2 label=(a=90 'PERCENTAGE WITH COMPLICATION');&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* whitespace left/right;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;title1 a=90 ls=5;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;title2 a=-90 ls=5;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;proc gplot data=mydata;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;plot (uti sep comps) * bmi / legend=legend1 vaxis=axis2 haxis=axis1 overlay noframe;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11980iC817F24ED160C596/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="plot.png" title="plot.png" /&gt;</description>
      <pubDate>Tue, 29 Sep 2015 19:37:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-construct-line-graph-of-complication-rate-by-BMI-percent/m-p/227747#M8250</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2015-09-29T19:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to construct line graph of complication rate by BMI percent</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-construct-line-graph-of-complication-rate-by-BMI-percent/m-p/228313#M8274</link>
      <description>&lt;P&gt;Something like this (untested)?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
  do UTI    ='Y','N';
  do SEPSIS ='Y','N';
    do BMI = 0.05 to 0.95 by 0.05;
      NBCASES=round(ranuni(0)*100);
      output;
    end;
  end;
  end;
run;

proc sql;
 create table RATES as
   select BMI
        , sum(NBCASES*(UTI    ='Y'))          /sum(NBCASES) as RATE_UTI
        , sum(NBCASES*(SEPSIS ='Y'))          /sum(NBCASES) as RATE_SEPSIS
        , sum(NBCASES*(SEPSIS ='Y')*(UTI='Y'))/sum(NBCASES) as RATE_COMPLIC
  from HAVE
  group by BMI;
quit;

proc plot data=RATES;
  plot (RATE_UTI RATE_SEPSIS RATE_COMPLIC)*BMI / overlay ;
  format RATE: percent.;
  run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2015 10:28:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-construct-line-graph-of-complication-rate-by-BMI-percent/m-p/228313#M8274</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2015-10-03T10:28:44Z</dc:date>
    </item>
  </channel>
</rss>

