<?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 Create VBAR and HBAR with percentages of a continuos variable in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Create-VBAR-and-HBAR-with-percentages-of-a-continuos-variable/m-p/598066#M18990</link>
    <description>&lt;P&gt;Hallo!&lt;/P&gt;&lt;P&gt;I would need some help to create a Graph with my data.&lt;/P&gt;&lt;P&gt;The dataset looks like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;                    
   input ID $ co2 $ area area_under area_over;      
   datalines; 
101 High 329274.45563 1161.4533333 328113.0023
101 Low 329807.07976 51867.348667 277939.7311
103 High 299940.79867 1437.205 298503.59367
103 Low 309707.27464 196061.47517 113645.79948
105 High 500296.11766 32079.163619 468216.95404
105 Low 330042.631 69774.392944 260268.23805;            
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and the graphS I would like to obtain like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;N.1&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="time under 90 percent.png" style="width: 421px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33319iF8240BB2E11ACD9E/image-dimensions/421x316?v=v2" width="421" height="316" role="button" title="time under 90 percent.png" alt="time under 90 percent.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where I have two vBars (one for every &lt;STRONG&gt;co2&lt;/STRONG&gt; level) and the blue part rapresent the percentage &lt;STRONG&gt;area_over&lt;/STRONG&gt;/&lt;STRONG&gt;area &lt;/STRONG&gt;and the red part rapresent the percentage &lt;STRONG&gt;area_under/area.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If possible I would also like to have a standard deviation bar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;N.2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second Graph I would like to have looks like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Unbenannt.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33320iA9F5E445C4B37424/image-size/large?v=v2&amp;amp;px=999" role="button" title="Unbenannt.png" alt="Unbenannt.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Riccardo&lt;/P&gt;</description>
    <pubDate>Mon, 21 Oct 2019 09:52:49 GMT</pubDate>
    <dc:creator>riccardo88</dc:creator>
    <dc:date>2019-10-21T09:52:49Z</dc:date>
    <item>
      <title>Create VBAR and HBAR with percentages of a continuos variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Create-VBAR-and-HBAR-with-percentages-of-a-continuos-variable/m-p/598066#M18990</link>
      <description>&lt;P&gt;Hallo!&lt;/P&gt;&lt;P&gt;I would need some help to create a Graph with my data.&lt;/P&gt;&lt;P&gt;The dataset looks like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;                    
   input ID $ co2 $ area area_under area_over;      
   datalines; 
101 High 329274.45563 1161.4533333 328113.0023
101 Low 329807.07976 51867.348667 277939.7311
103 High 299940.79867 1437.205 298503.59367
103 Low 309707.27464 196061.47517 113645.79948
105 High 500296.11766 32079.163619 468216.95404
105 Low 330042.631 69774.392944 260268.23805;            
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and the graphS I would like to obtain like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;N.1&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="time under 90 percent.png" style="width: 421px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33319iF8240BB2E11ACD9E/image-dimensions/421x316?v=v2" width="421" height="316" role="button" title="time under 90 percent.png" alt="time under 90 percent.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where I have two vBars (one for every &lt;STRONG&gt;co2&lt;/STRONG&gt; level) and the blue part rapresent the percentage &lt;STRONG&gt;area_over&lt;/STRONG&gt;/&lt;STRONG&gt;area &lt;/STRONG&gt;and the red part rapresent the percentage &lt;STRONG&gt;area_under/area.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If possible I would also like to have a standard deviation bar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;N.2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second Graph I would like to have looks like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Unbenannt.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33320iA9F5E445C4B37424/image-size/large?v=v2&amp;amp;px=999" role="button" title="Unbenannt.png" alt="Unbenannt.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Riccardo&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 09:52:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Create-VBAR-and-HBAR-with-percentages-of-a-continuos-variable/m-p/598066#M18990</guid>
      <dc:creator>riccardo88</dc:creator>
      <dc:date>2019-10-21T09:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create VBAR and HBAR with percentages of a continuos variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Create-VBAR-and-HBAR-with-percentages-of-a-continuos-variable/m-p/598154#M18991</link>
      <description>&lt;P&gt;Where do the 0 and 1 come from for the first graph???&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like as at least one step you need something like:&lt;/P&gt;
&lt;PRE&gt;data have;                    
   input ID $ co2 $ area area_under area_over;  
   under =   area_under/area;
   over  =   area_over /area;
   datalines; 
101 High 329274.45563 1161.4533333 328113.0023
101 Low 329807.07976 51867.348667 277939.7311
103 High 299940.79867 1437.205 298503.59367
103 Low 309707.27464 196061.47517 113645.79948
105 High 500296.11766 32079.163619 468216.95404
105 Low 330042.631 69774.392944 260268.23805
;            
Run;&lt;/PRE&gt;
&lt;P&gt;(Note: the semicolon to end a datalines block must be after the last line of data)&lt;/P&gt;
&lt;P&gt;Or perhaps you intend to sum the area, area_under and area_over and then do the percentages. But I can't tell which.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 14:59:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Create-VBAR-and-HBAR-with-percentages-of-a-continuos-variable/m-p/598154#M18991</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-10-21T14:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create VBAR and HBAR with percentages of a continuos variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Create-VBAR-and-HBAR-with-percentages-of-a-continuos-variable/m-p/598179#M18995</link>
      <description>&lt;P&gt;Try the following and see if they meet your needs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   input ID $ co2 $ area area_under area_over;
   datalines;
101 High 329274.45563 1161.4533333 328113.0023
101 Low 329807.07976 51867.348667 277939.7311
103 High 299940.79867 1437.205 298503.59367
103 Low 309707.27464 196061.47517 113645.79948
105 High 500296.11766 32079.163619 468216.95404
105 Low 330042.631 69774.392944 260268.23805
;
Run;

data have_neg;
set have;
area_under = -1 * area_under;
run;

proc format;
proc format;
picture posval low-high='000,009';
run;

proc sgplot data=have;
yaxis label="Area";
vbar co2 / response=area_under stat=mean limitstat=stddev discreteoffset=-0.2 barwidth=0.4;
vbar co2 / response=area_over  stat=mean limitstat=stddev discreteoffset=0.2 barwidth=0.4;
run;

proc sgplot data=have_neg;
format area_under posval.;
xaxis label="Area";
hbar co2 / response=area_under stat=mean;
hbar co2 / response=area_over  stat=mean;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps!&lt;BR /&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 17:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Create-VBAR-and-HBAR-with-percentages-of-a-continuos-variable/m-p/598179#M18995</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-10-21T17:22:08Z</dc:date>
    </item>
  </channel>
</rss>

