<?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: I need to truncate standard deviation error bars at zero in sgplot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/I-need-to-truncate-standard-deviation-error-bars-at-zero-in/m-p/875892#M23790</link>
    <description>&lt;P&gt;As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;said, you will not be able to do this directly using VLINE. You will need to calculate the standard deviations externally and flag the values that drop below zero. Then, combine a SERIES and a HIGHTLOW plot to draw the graph. I would recommend using a HIGHLOW plot to represent the STDDEV values, as you can put different styles of endcaps on the lines from the data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the data step to process your +/- STDDEV value, create a column called LOWCAP (or whatever you want to call it) to store the symbol to use on the low end of the HIGHLOW lines. If the low value is &amp;gt;= 0, set the value in this column to be "SERIF". If the value is &amp;lt; 0, set the low value to be 0, and set the LOWCAP value to be OPENARROW. Then, set the LOWCAP option on the HIGHLOW plot to point to this column, while setting "SERIF" on the HIGHCAP option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 May 2023 20:51:36 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2023-05-15T20:51:36Z</dc:date>
    <item>
      <title>I need to truncate standard deviation error bars at zero in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/I-need-to-truncate-standard-deviation-error-bars-at-zero-in/m-p/875850#M23788</link>
      <description>&lt;P&gt;I have an SG Plot using the code below. Two of my stddev error bars extend below zero. I want to truncate them at zero and add a symbol to the end of the error bars. Any ideas? Thanks in advance.&lt;/P&gt;&lt;P&gt;proc sgplot data=ssprox noautolegend;&lt;BR /&gt;format /*VIS yyf.*/ cdstcn2 ccc.;&lt;/P&gt;&lt;P&gt;styleattrs datasymbols=(circle circle circlefilled squarefilled ) datalinepatterns=(solid shortdash dash longdash) datacontrastcolors=(red gray4C blue green);&lt;BR /&gt;vline vis / response=var1 group=cdstcn2 stat=Mean limitstat=stddev markers markerattrs=(size=10) discreteoffset=-0.2 name="In" /*datalabel*/;&lt;BR /&gt;vline vis / response=var2 group=cdstcn2 stat=Mean limitstat=stddev markers markerattrs=(size=10) discreteoffset=-0.1 /*datalabel*/;&lt;BR /&gt;vline vis / response=var3 group=cdstcn2 stat=Mean limitstat=stddev markers markerattrs=(size=10) discreteoffset=0.1 /*datalabel*/;&lt;BR /&gt;vline vis / response=var4 group=cdstcn2 stat=Mean limitstat=stddev markers markerattrs=(size=10) discreteoffset=0.2 /*datalabel*/;&lt;BR /&gt;yaxis label= 'Mean PRO2' values=(0 to 30 by 5) offsetmin=.05 offsetmax=.05 minor minorcount=4 labelattrs=(family='SWISSL');&lt;BR /&gt;xaxis values=(0 to 52 by 2) offsetmin=.02 offsetmax=.02 labelattrs=(family='SWISSL');&lt;BR /&gt;keylegend "In"/title = "CDST-category" /* position=topright */ location=outside noborder;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 17:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/I-need-to-truncate-standard-deviation-error-bars-at-zero-in/m-p/875850#M23788</guid>
      <dc:creator>yportne1177</dc:creator>
      <dc:date>2023-05-15T17:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: I need to truncate standard deviation error bars at zero in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/I-need-to-truncate-standard-deviation-error-bars-at-zero-in/m-p/875890#M23789</link>
      <description>&lt;P&gt;I don't think that "truncation" will be possible with the VLINE LIMITSTAT options. If you want to control one end of an error bar separate from the other then you may need to look at a plot that uses different limit variables for upper and lower values, such as the SCATTER Yerrorlower and Yerrorupper or the BAND plot UPPER and LOWER variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't provide any data so not going to attempt specific code to accomplish anything.&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 20:34:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/I-need-to-truncate-standard-deviation-error-bars-at-zero-in/m-p/875890#M23789</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-05-15T20:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: I need to truncate standard deviation error bars at zero in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/I-need-to-truncate-standard-deviation-error-bars-at-zero-in/m-p/875892#M23790</link>
      <description>&lt;P&gt;As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;said, you will not be able to do this directly using VLINE. You will need to calculate the standard deviations externally and flag the values that drop below zero. Then, combine a SERIES and a HIGHTLOW plot to draw the graph. I would recommend using a HIGHLOW plot to represent the STDDEV values, as you can put different styles of endcaps on the lines from the data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the data step to process your +/- STDDEV value, create a column called LOWCAP (or whatever you want to call it) to store the symbol to use on the low end of the HIGHLOW lines. If the low value is &amp;gt;= 0, set the value in this column to be "SERIF". If the value is &amp;lt; 0, set the low value to be 0, and set the LOWCAP value to be OPENARROW. Then, set the LOWCAP option on the HIGHLOW plot to point to this column, while setting "SERIF" on the HIGHCAP option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 20:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/I-need-to-truncate-standard-deviation-error-bars-at-zero-in/m-p/875892#M23790</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2023-05-15T20:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: I need to truncate standard deviation error bars at zero in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/I-need-to-truncate-standard-deviation-error-bars-at-zero-in/m-p/876277#M23791</link>
      <description>&lt;P&gt;Thanks for the prompt and detailed solution!&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 16:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/I-need-to-truncate-standard-deviation-error-bars-at-zero-in/m-p/876277#M23791</guid>
      <dc:creator>yportne1177</dc:creator>
      <dc:date>2023-05-17T16:45:21Z</dc:date>
    </item>
  </channel>
</rss>

