<?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: Waterfall plot , space between groups and labeling the groups in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Waterfall-plot-space-between-groups-and-labeling-the-groups/m-p/857727#M338917</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
Why not try PROC SGPANEL ?

Next time if you want get answer,
It better to post some data to test your code.
*/
data have;
call streaminit(123);
 do id=1 to 100;
   sex=ifc(id&amp;lt;70,'M','F');
   p=rand('integer',-100,100);
   output;
 end;
run;
proc sort data=have;by descending sex descending p;run;
data want;
 set have end=last;
 by descending sex;
 output;
 if last.sex and not last then do;
   do id=99991 to 99999;
    p=0;output;
   end;
 end;
run;

proc sgplot data=want noautolegend;
vbarparm category=id response=p/group=sex ;
refline 99995/axis=x  lineattrs=(pattern=shortdash color=black);
xaxis display =(noticks novalues noline) discreteorder=data  
label='Treatment(N=44)                                                       Placebo(N=67)';
yaxis label="Change from baseline (%)" values= (-100 to 100 by 10) 
valuesdisplay=('&amp;lt;=100' '-90' '-80' '-70' '-60' '-50' '-40' '-30' '-20' 
  '-10' '0' '10' '20' '30' '40' '50' '60' '70' '80' '90' '&amp;gt;=100') ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1675856390308.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80205i02DB895A149BA720/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1675856390308.png" alt="Ksharp_0-1675856390308.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Feb 2023 11:40:18 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2023-02-08T11:40:18Z</dc:date>
    <item>
      <title>Waterfall plot , space between groups and labeling the groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Waterfall-plot-space-between-groups-and-labeling-the-groups/m-p/857632#M338878</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Im using this code to create the following plot in rtf. im using sas studio .0.&lt;/P&gt;&lt;P&gt;The issue i have are:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;1) need a couple of space between the blue and red bars (not individual bars). I tried clusterwidth and its not working.The vertical dashed line has to ob on the space between the blue group and red group.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;2)&amp;nbsp; I also need a label under each group just below the x axis line (not the legend) .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=adtss2 noautolegend;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;vbar pos/ response=PCHG group=ESMMB GROUPDISPLAY=CLUSTER clusterwidth=1 barwidth=.8/*FILLATTRS = (COLOR=lightblue)*/ nooutline;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;refline 25,35 / axis=y lineattrs=(pattern=shortdash color=grey);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;refline &amp;amp;xref / axis=x lineattrs=(pattern=shortdash color=black);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;xaxis display =none;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;yaxis label="Change from baseline (%)" values= (-100 to 100 by 10) valuesdisplay=('&amp;lt;=100' '-90' '-80' '-70' '-60' '-50' '-40' '-30' '-20' '-10' '0' '10' '20' '30' '40' '50' '60' '70' '80' '90' '&amp;gt;=100') valueshint;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Manj_1-1675794051546.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80183i61F999CB11201701/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Manj_1-1675794051546.png" alt="Manj_1-1675794051546.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Manj&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 18:23:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Waterfall-plot-space-between-groups-and-labeling-the-groups/m-p/857632#M338878</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2023-02-07T18:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Waterfall plot , space between groups and labeling the groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Waterfall-plot-space-between-groups-and-labeling-the-groups/m-p/857727#M338917</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
Why not try PROC SGPANEL ?

Next time if you want get answer,
It better to post some data to test your code.
*/
data have;
call streaminit(123);
 do id=1 to 100;
   sex=ifc(id&amp;lt;70,'M','F');
   p=rand('integer',-100,100);
   output;
 end;
run;
proc sort data=have;by descending sex descending p;run;
data want;
 set have end=last;
 by descending sex;
 output;
 if last.sex and not last then do;
   do id=99991 to 99999;
    p=0;output;
   end;
 end;
run;

proc sgplot data=want noautolegend;
vbarparm category=id response=p/group=sex ;
refline 99995/axis=x  lineattrs=(pattern=shortdash color=black);
xaxis display =(noticks novalues noline) discreteorder=data  
label='Treatment(N=44)                                                       Placebo(N=67)';
yaxis label="Change from baseline (%)" values= (-100 to 100 by 10) 
valuesdisplay=('&amp;lt;=100' '-90' '-80' '-70' '-60' '-50' '-40' '-30' '-20' 
  '-10' '0' '10' '20' '30' '40' '50' '60' '70' '80' '90' '&amp;gt;=100') ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1675856390308.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80205i02DB895A149BA720/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1675856390308.png" alt="Ksharp_0-1675856390308.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 11:40:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Waterfall-plot-space-between-groups-and-labeling-the-groups/m-p/857727#M338917</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-02-08T11:40:18Z</dc:date>
    </item>
  </channel>
</rss>

