<?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: sgplot vbar data label of sum in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-data-label-of-sum/m-p/408172#M13962</link>
    <description>&lt;P&gt;I was talking with Sanjay about this one, and he pointed out that another alternative would be to just pre-compute the data in PROC MEANS and use a VBARPARM to render it. Here's what that would look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=sashelp.class nway;
class age;
var weight;
output out=temp mean=weight_mean n=weight_n;
run;

proc sgplot data=temp;
vbarparm category=age response=weight_mean / datalabel=weight_n;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Oct 2017 21:07:50 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2017-10-27T21:07:50Z</dc:date>
    <item>
      <title>sgplot vbar data label of sum</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-data-label-of-sum/m-p/408165#M13958</link>
      <description>&lt;P&gt;I am running an sgplot vbar where the stat is the mean and I would like to label each vbar with the sample size in each group. is there a way I can do this, something like datalabel=(stat=sum) [but this does not work].&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 20:32:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-data-label-of-sum/m-p/408165#M13958</guid>
      <dc:creator>Melk</dc:creator>
      <dc:date>2017-10-27T20:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot vbar data label of sum</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-data-label-of-sum/m-p/408166#M13959</link>
      <description>&lt;P&gt;How about something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.class;
vbar age / response=weight stat=mean;
xaxistable weight / stat=freq location=inside
                    position=top;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Oct 2017 20:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-data-label-of-sum/m-p/408166#M13959</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2017-10-27T20:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot vbar data label of sum</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-data-label-of-sum/m-p/408168#M13960</link>
      <description>&lt;P&gt;I am formatting the response variable as a percent since it is a binary variable, and I want the proportion of 1s (vs 0s). I want the total sample size in each group to be displayed per bar (num of 0s + 1s).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because of this format I think, when I run with your suggestions it is giving me percentages rather than counts. Am I able to employ 2 different formats for the same variable within a proc block?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=dat;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;vbar days / response=mort stat=mean;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;format mort percent6.2;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 20:54:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-data-label-of-sum/m-p/408168#M13960</guid>
      <dc:creator>Melk</dc:creator>
      <dc:date>2017-10-27T20:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot vbar data label of sum</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-data-label-of-sum/m-p/408171#M13961</link>
      <description>&lt;P&gt;What version of SAS are you using?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 21:02:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-data-label-of-sum/m-p/408171#M13961</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2017-10-27T21:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot vbar data label of sum</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-data-label-of-sum/m-p/408172#M13962</link>
      <description>&lt;P&gt;I was talking with Sanjay about this one, and he pointed out that another alternative would be to just pre-compute the data in PROC MEANS and use a VBARPARM to render it. Here's what that would look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=sashelp.class nway;
class age;
var weight;
output out=temp mean=weight_mean n=weight_n;
run;

proc sgplot data=temp;
vbarparm category=age response=weight_mean / datalabel=weight_n;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 21:07:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-data-label-of-sum/m-p/408172#M13962</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2017-10-27T21:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot vbar data label of sum</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-data-label-of-sum/m-p/408177#M13964</link>
      <description>&lt;P&gt;Worked beautifully - much appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 21:14:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-data-label-of-sum/m-p/408177#M13964</guid>
      <dc:creator>Melk</dc:creator>
      <dc:date>2017-10-27T21:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot vbar data label of sum</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-data-label-of-sum/m-p/408178#M13965</link>
      <description>&lt;P&gt;SAS 9.4&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 21:14:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-data-label-of-sum/m-p/408178#M13965</guid>
      <dc:creator>Melk</dc:creator>
      <dc:date>2017-10-27T21:14:29Z</dc:date>
    </item>
  </channel>
</rss>

