<?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 sgplot with Multiple variables on vbar in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/sgplot-with-Multiple-variables-on-vbar/m-p/368363#M18841</link>
    <description>&lt;P&gt;SAS v 9.3&lt;/P&gt;&lt;P&gt;I am trying to generate a simple sgplot with percentages.&amp;nbsp; I want to be able to add multiple variables on the vbar&amp;nbsp;statement but that is not an option.&amp;nbsp;I have&amp;nbsp;I am also having trouble creating a data set from my proc freq that includes ALL of my variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; work.ins15;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;set&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; ins.ins15;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008000" face="Courier New"&gt;freq&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#008080" face="Courier New"&gt;data&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=work.ins15;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;tables&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; cig ecig chew / &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;plots&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=FreqPlot(scale=Percent) &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;out&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=Freq1Out; &lt;/FONT&gt;&lt;FONT color="#0080ff" face="Courier New"&gt;/* save Percent variable */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;weight&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; _cpwt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;where&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; cig=&lt;/FONT&gt;&lt;FONT color="#00ae00" face="Courier New"&gt;1&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; and ecig=&lt;/FONT&gt;&lt;FONT color="#00ae00" face="Courier New"&gt;1&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; and chew=&lt;/FONT&gt;&lt;FONT color="#00ae00" face="Courier New"&gt;1&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; Freq1Out;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;set&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; Freq1Out ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Courier New"&gt;Percent = Percent / &lt;/FONT&gt;&lt;FONT color="#00ae00" face="Courier New"&gt;100&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;; &lt;/FONT&gt;&lt;FONT color="#0080ff" face="Courier New"&gt;/* adjust range to [0, 1] */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;format&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; Percent &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New"&gt;PERCENT5.&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;title&lt;/FONT&gt; &lt;FONT color="#000080" face="Courier New"&gt;""&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008000" face="Courier New"&gt;sgplot&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#008080" face="Courier New"&gt;data&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=Freq1Out &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;noborder&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;vbar&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; cig / &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;response&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=Percent &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;datalabel&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;fillattrs&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=(&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;color&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=blue); &lt;/FONT&gt;&lt;FONT color="#0080ff" face="Courier New"&gt;/* axis shows percentages instead of counts */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;xaxis&lt;/FONT&gt; &lt;FONT color="#008080" face="Courier New"&gt;display&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=(nolabel);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;yaxis&lt;/FONT&gt; &lt;FONT color="#008080" face="Courier New"&gt;display&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=(nolabel) ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jun 2017 15:34:01 GMT</pubDate>
    <dc:creator>Whitlea</dc:creator>
    <dc:date>2017-06-19T15:34:01Z</dc:date>
    <item>
      <title>sgplot with Multiple variables on vbar</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/sgplot-with-Multiple-variables-on-vbar/m-p/368363#M18841</link>
      <description>&lt;P&gt;SAS v 9.3&lt;/P&gt;&lt;P&gt;I am trying to generate a simple sgplot with percentages.&amp;nbsp; I want to be able to add multiple variables on the vbar&amp;nbsp;statement but that is not an option.&amp;nbsp;I have&amp;nbsp;I am also having trouble creating a data set from my proc freq that includes ALL of my variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; work.ins15;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;set&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; ins.ins15;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008000" face="Courier New"&gt;freq&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#008080" face="Courier New"&gt;data&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=work.ins15;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;tables&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; cig ecig chew / &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;plots&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=FreqPlot(scale=Percent) &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;out&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=Freq1Out; &lt;/FONT&gt;&lt;FONT color="#0080ff" face="Courier New"&gt;/* save Percent variable */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;weight&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; _cpwt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;where&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; cig=&lt;/FONT&gt;&lt;FONT color="#00ae00" face="Courier New"&gt;1&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; and ecig=&lt;/FONT&gt;&lt;FONT color="#00ae00" face="Courier New"&gt;1&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; and chew=&lt;/FONT&gt;&lt;FONT color="#00ae00" face="Courier New"&gt;1&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; Freq1Out;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;set&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; Freq1Out ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Courier New"&gt;Percent = Percent / &lt;/FONT&gt;&lt;FONT color="#00ae00" face="Courier New"&gt;100&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;; &lt;/FONT&gt;&lt;FONT color="#0080ff" face="Courier New"&gt;/* adjust range to [0, 1] */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;format&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; Percent &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New"&gt;PERCENT5.&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;title&lt;/FONT&gt; &lt;FONT color="#000080" face="Courier New"&gt;""&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008000" face="Courier New"&gt;sgplot&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#008080" face="Courier New"&gt;data&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=Freq1Out &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;noborder&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;vbar&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt; cig / &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;response&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=Percent &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;datalabel&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;fillattrs&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=(&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;color&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=blue); &lt;/FONT&gt;&lt;FONT color="#0080ff" face="Courier New"&gt;/* axis shows percentages instead of counts */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;xaxis&lt;/FONT&gt; &lt;FONT color="#008080" face="Courier New"&gt;display&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=(nolabel);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New"&gt;yaxis&lt;/FONT&gt; &lt;FONT color="#008080" face="Courier New"&gt;display&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;=(nolabel) ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 15:34:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/sgplot-with-Multiple-variables-on-vbar/m-p/368363#M18841</guid>
      <dc:creator>Whitlea</dc:creator>
      <dc:date>2017-06-19T15:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with Multiple variables on vbar</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/sgplot-with-Multiple-variables-on-vbar/m-p/601561#M23456</link>
      <description>&lt;P&gt;For outputting multiple variables in frequency tables, please use multiple table statements. Similarly, to add multiple variables on a vertical bar graph, please try using multiple vbar statements. Please see also this post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Graphics-Programming/sgplot-with-Multiple-variables-on-vbar/td-p/388772" target="_blank"&gt;https://communities.sas.com/t5/Graphics-Programming/sgplot-with-Multiple-variables-on-vbar/td-p/388772&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 03:15:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/sgplot-with-Multiple-variables-on-vbar/m-p/601561#M23456</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2019-11-05T03:15:34Z</dc:date>
    </item>
  </channel>
</rss>

