<?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: proc sgplot, plotting OR's and CI in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437122#M108809</link>
    <description>&lt;P&gt;Thanks for that.&lt;/P&gt;&lt;P&gt;Unfortunately that won't work in this case because my OR is a point estimate as are my Confidence intervals. I do not have a numeric continuous variable to plot on the Y axis .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have seen may iterations of the solution you mention but not one that will plot a line between my specified OR extimate and the CI's&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Feb 2018 15:09:09 GMT</pubDate>
    <dc:creator>ChristosK</dc:creator>
    <dc:date>2018-02-14T15:09:09Z</dc:date>
    <item>
      <title>proc sgplot, plotting OR's and CI</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437107#M108805</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This seems to simple but thought I should ask anyway:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have values for an OR &amp;nbsp;and 95% CI already worked out, and want to plot these OR's on the y axis with time of event on the x axis .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data =VPPlotsforSAS1 (where=(level=1));&lt;BR /&gt;scatter x=Vasoplegia_Time y=OR /&lt;BR /&gt;group=Blood_Pressure groupdisplay=cluster clusterwidth=0.5;&lt;BR /&gt;xaxis type =discrete;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I create a whisker plot or forrest plot with the upper or lower or both CI's connected with a line to the OR point estimate?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 14:50:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437107#M108805</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-02-14T14:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot, plotting OR's and CI</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437117#M108808</link>
      <description>&lt;P&gt;If you have separate variables that contain the upper and lower limit you want to display then the options Yerrorupper=upperlimitvariable yerrorlower=lowerlimitvariable as options on your scatter statement should do what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if your are using an older version of SAS this may not work depending on the version as there have been many additions to graphing options in recent releases.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 15:03:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437117#M108808</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-02-14T15:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot, plotting OR's and CI</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437122#M108809</link>
      <description>&lt;P&gt;Thanks for that.&lt;/P&gt;&lt;P&gt;Unfortunately that won't work in this case because my OR is a point estimate as are my Confidence intervals. I do not have a numeric continuous variable to plot on the Y axis .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have seen may iterations of the solution you mention but not one that will plot a line between my specified OR extimate and the CI's&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 15:09:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437122#M108809</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-02-14T15:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot, plotting OR's and CI</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437160#M108823</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/48542"&gt;@ChristosK&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for that.&lt;/P&gt;
&lt;P&gt;Unfortunately that won't work in this case because my OR is a point estimate as are my Confidence intervals. I do not have a numeric continuous variable to plot on the Y axis .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have seen may iterations of the solution you mention but not one that will plot a line between my specified OR extimate and the CI's&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;Do you or do you not have upper confidence limits at the x variable for your OR vales? You have to have something to attempt to plot, so what is it. Your OR is already getting plotted against a continuous y axis.&lt;/P&gt;
&lt;P&gt;Perhaps you want&amp;nbsp;two series plots connecting the upper and lower limits.&lt;/P&gt;
&lt;P&gt;Or maybe &amp;nbsp;a Band plot along with that scatter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the following example y is your OR variable and the yupper and ylower are the limits of the confidence interval. The limits are connected to the limits. If you don't like the appearance of the limit lines then the ERRORBARATTRS style elements control color, line type and thickness of the line.&lt;/P&gt;
&lt;PRE&gt;data junk;
   do x= 1 to 10;
      y= 50*rand('uniform');
      yupper= 1.05*y;
      ylower= .95*y;
      output;
   end;
run;

proc sgplot data=junk;
   scatter x=x y=y/yerrorupper=yupper yerrorlower=ylower;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Feb 2018 15:53:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437160#M108823</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-02-14T15:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot, plotting OR's and CI</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437186#M108833</link>
      <description>&lt;P&gt;&lt;A href="https://blogs.sas.com/content/tag/forest-plot/" target="_blank"&gt;https://blogs.sas.com/content/tag/forest-plot/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Several examples of exactly what you want in those posts, including examples of subgroup analysis.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 16:16:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437186#M108833</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-14T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot, plotting OR's and CI</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437271#M108844</link>
      <description>&lt;P&gt;Thank you, that worked out very nicely.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just one other question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data =VPPlotsforSAS1 (where=(level=1));&lt;BR /&gt;scatter x=Vp y=OR / yerrorupper=UCL errorbarattrs&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;colorresponse =&lt;/FONT&gt; startcolor=blue NEUTRALCOLOR=yellow ENDCOLOR=aliceblue&lt;BR /&gt;/* yerrorlower=LCL */&lt;BR /&gt;group=Blood_Pressure groupdisplay=cluster clusterwidth=0.5;&lt;BR /&gt;xaxis type =discrete;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting an error message here&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;&lt;FONT color="#FF0000"&gt;ERROR 73-322: Expecting an =.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;FONT color="#FF0000"&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;FONT color="#000000"&gt;It says I need to put an = sign, but&amp;nbsp;there is one , and changing the&amp;nbsp;number of spaces&amp;nbsp;and brackets seems not to make a&amp;nbsp;difference.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;FONT color="#000000"&gt;Im trying&amp;nbsp;too&amp;nbsp;assign pre-specified colours for the&amp;nbsp;three blood pressures that are&amp;nbsp;clustered at each&amp;nbsp;level on the x axis&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Feb 2018 19:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437271#M108844</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-02-14T19:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot, plotting OR's and CI</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437272#M108845</link>
      <description>&lt;P&gt;Thanks Reeza, this is fantastic!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 19:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437272#M108845</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-02-14T19:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot, plotting OR's and CI</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437327#M108871</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/48542"&gt;@ChristosK&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you, that worked out very nicely.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just one other question:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data =VPPlotsforSAS1 (where=(level=1));&lt;BR /&gt;scatter x=Vp y=OR / yerrorupper=UCL errorbarattrs&lt;BR /&gt;&lt;FONT color="#0000ff"&gt;colorresponse =&lt;/FONT&gt; startcolor=blue NEUTRALCOLOR=yellow ENDCOLOR=aliceblue&lt;BR /&gt;/* yerrorlower=LCL */&lt;BR /&gt;group=Blood_Pressure groupdisplay=cluster clusterwidth=0.5;&lt;BR /&gt;xaxis type =discrete;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm getting an error message here&amp;nbsp;&lt;/P&gt;
&lt;DIV class="sasError"&gt;&lt;FONT color="#ff0000"&gt;ERROR 73-322: Expecting an =.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;&lt;FONT color="#ff0000"&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;&lt;FONT color="#000000"&gt;It says I need to put an = sign, but&amp;nbsp;there is one , and changing the&amp;nbsp;number of spaces&amp;nbsp;and brackets seems not to make a&amp;nbsp;difference.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;&lt;FONT color="#000000"&gt;Im trying&amp;nbsp;too&amp;nbsp;assign pre-specified colours for the&amp;nbsp;three blood pressures that are&amp;nbsp;clustered at each&amp;nbsp;level on the x axis&lt;/FONT&gt;&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;ERRORBARATTRS is likely the proximate cause of the error message as that option&amp;nbsp;requires an = but you do not have one. Something like:&lt;/P&gt;
&lt;P&gt;Errorbarattrs =(color=green pattern=dotdash)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to change the errorbar attributes for each group then you may want to use a styleattrs statement or go all the way to a DATTRMAP data set. Errorbarattrs colors by default come from ContrastColor attribute in the current styles GraphDataN definitions. So you could use&lt;/P&gt;
&lt;P&gt;Styleattrs&amp;nbsp; datacontrastcolors=(red green blue); to assign those contrast colors (which also affect things like vbar/hbar borders, marker outlines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think that colorresponse and colormodel are what you really want unless you want to apply a gradient color to markers of the scatter based on another variable.&lt;/P&gt;
&lt;P&gt;The colorresponse should point to a variable with a numeric value that indicates where in the color gradient you want a value (the procedure automatically scales to the gradient)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The COLORMODEL would have the colors, either a style reference or a triplet of names with the first the Start color, second the "neutral" or midrange, and third the end color.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so your code would use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;colormodel = (blue yellow aliceblue) colorresponse= somenumericvar&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;note that if you use colorresponse that GROUP will be ignored. If you need to show different bit for the group variable you might change to SGPANEL and use that variable as a PANELBY variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With a colormodel colorresponse you likely want to include a GRADLEGEND statement to have some explanation of the color range.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want to peruse here for some examples of graphs with data and code:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/sassamples/graphgallery/index.html" target="_blank"&gt;http://support.sas.com/sassamples/graphgallery/index.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://robslink.com/SAS/" target="_blank"&gt;http://robslink.com/SAS/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 22:08:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-plotting-OR-s-and-CI/m-p/437327#M108871</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-02-14T22:08:50Z</dc:date>
    </item>
  </channel>
</rss>

