<?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 Incorrect Display Proc Chart Group from Proc Format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Incorrect-Display-Proc-Chart-Group-from-Proc-Format/m-p/436911#M108723</link>
    <description>&lt;P&gt;I am analysing an excel survey. Responses that have text value, they are recorded in numeric form. Example:&lt;/P&gt;&lt;P&gt;Q1. How often does your household purchase food from a grocery store?&lt;BR /&gt;9 Never&lt;BR /&gt;10 Once a month or less&lt;BR /&gt;11 2-3 times a month&lt;BR /&gt;12 Weekly&lt;BR /&gt;13 2-3 times a week&lt;BR /&gt;14 Daily&lt;/P&gt;&lt;P&gt;The column for that question having only number values.&lt;/P&gt;&lt;P&gt;For a question where the answer is on a scale from 1 to 10, I have made a proc format to group responses into categories.&lt;/P&gt;&lt;P&gt;When charting the questions, the grouping are not working.&lt;/P&gt;&lt;P&gt;My code is:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data survey;&lt;BR /&gt;set mylib.thesisdata2;&lt;BR /&gt;rename VAR4=Q1;&lt;BR /&gt;rename VAR6=Q3;&lt;BR /&gt;run;&lt;BR /&gt;proc format;&lt;BR /&gt;value typea&lt;BR /&gt;0='.'&lt;BR /&gt;9='Never'&lt;BR /&gt;10='Once a month or less'&lt;BR /&gt;11='2-3 times a month'&lt;BR /&gt;12='Weekly'&lt;BR /&gt;13='2-3 times a week'&lt;BR /&gt;14='Daily';&lt;BR /&gt;run;&lt;BR /&gt;proc format;&lt;BR /&gt;value typec&lt;BR /&gt;low-&amp;lt;4 = 'Low 1-3'&lt;BR /&gt;4-&amp;lt;7= 'Medium 4-6'&lt;BR /&gt;7-high='High 7-10';&lt;BR /&gt;run;&lt;BR /&gt;proc format;&lt;BR /&gt;run;&lt;BR /&gt;proc chart data=Survey;&lt;BR /&gt;vbar Q1 / type=percent;&lt;BR /&gt;format Q1 typea.;&lt;BR /&gt;title 'How often does your household purchase food from a grocery store?';&lt;BR /&gt;run;&lt;BR /&gt;proc chart data=Survey;&lt;BR /&gt;format Q3 typec.;&lt;BR /&gt;vbar Q3 / subgroup=vermont;&lt;BR /&gt;title 'How knowledgeable do you think you are about organically grown fresh&lt;BR /&gt;produce?';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc freq data=Survey;&lt;BR /&gt;format Q1 typea.;&lt;BR /&gt;format Q3 typec.;&lt;BR /&gt;tables Q1 Q3;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the results are:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ExFREQ.png" style="width: 532px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18508iDDF36701ACC31425/image-size/large?v=v2&amp;amp;px=999" role="button" title="ExFREQ.png" alt="ExFREQ.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ExQ3.png" style="width: 542px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18507iC23FADC1930F2A3E/image-size/large?v=v2&amp;amp;px=999" role="button" title="ExQ3.png" alt="ExQ3.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ExQ1.png" style="width: 432px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18509i46EF06A632488592/image-size/large?v=v2&amp;amp;px=999" role="button" title="ExQ1.png" alt="ExQ1.png" /&gt;&lt;/span&gt;Any guesses as to why the categories for the graphs are so wonky?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 13 Feb 2018 22:38:38 GMT</pubDate>
    <dc:creator>vsl2000</dc:creator>
    <dc:date>2018-02-13T22:38:38Z</dc:date>
    <item>
      <title>Incorrect Display Proc Chart Group from Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorrect-Display-Proc-Chart-Group-from-Proc-Format/m-p/436911#M108723</link>
      <description>&lt;P&gt;I am analysing an excel survey. Responses that have text value, they are recorded in numeric form. Example:&lt;/P&gt;&lt;P&gt;Q1. How often does your household purchase food from a grocery store?&lt;BR /&gt;9 Never&lt;BR /&gt;10 Once a month or less&lt;BR /&gt;11 2-3 times a month&lt;BR /&gt;12 Weekly&lt;BR /&gt;13 2-3 times a week&lt;BR /&gt;14 Daily&lt;/P&gt;&lt;P&gt;The column for that question having only number values.&lt;/P&gt;&lt;P&gt;For a question where the answer is on a scale from 1 to 10, I have made a proc format to group responses into categories.&lt;/P&gt;&lt;P&gt;When charting the questions, the grouping are not working.&lt;/P&gt;&lt;P&gt;My code is:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data survey;&lt;BR /&gt;set mylib.thesisdata2;&lt;BR /&gt;rename VAR4=Q1;&lt;BR /&gt;rename VAR6=Q3;&lt;BR /&gt;run;&lt;BR /&gt;proc format;&lt;BR /&gt;value typea&lt;BR /&gt;0='.'&lt;BR /&gt;9='Never'&lt;BR /&gt;10='Once a month or less'&lt;BR /&gt;11='2-3 times a month'&lt;BR /&gt;12='Weekly'&lt;BR /&gt;13='2-3 times a week'&lt;BR /&gt;14='Daily';&lt;BR /&gt;run;&lt;BR /&gt;proc format;&lt;BR /&gt;value typec&lt;BR /&gt;low-&amp;lt;4 = 'Low 1-3'&lt;BR /&gt;4-&amp;lt;7= 'Medium 4-6'&lt;BR /&gt;7-high='High 7-10';&lt;BR /&gt;run;&lt;BR /&gt;proc format;&lt;BR /&gt;run;&lt;BR /&gt;proc chart data=Survey;&lt;BR /&gt;vbar Q1 / type=percent;&lt;BR /&gt;format Q1 typea.;&lt;BR /&gt;title 'How often does your household purchase food from a grocery store?';&lt;BR /&gt;run;&lt;BR /&gt;proc chart data=Survey;&lt;BR /&gt;format Q3 typec.;&lt;BR /&gt;vbar Q3 / subgroup=vermont;&lt;BR /&gt;title 'How knowledgeable do you think you are about organically grown fresh&lt;BR /&gt;produce?';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc freq data=Survey;&lt;BR /&gt;format Q1 typea.;&lt;BR /&gt;format Q3 typec.;&lt;BR /&gt;tables Q1 Q3;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the results are:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ExFREQ.png" style="width: 532px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18508iDDF36701ACC31425/image-size/large?v=v2&amp;amp;px=999" role="button" title="ExFREQ.png" alt="ExFREQ.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ExQ3.png" style="width: 542px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18507iC23FADC1930F2A3E/image-size/large?v=v2&amp;amp;px=999" role="button" title="ExQ3.png" alt="ExQ3.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ExQ1.png" style="width: 432px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18509i46EF06A632488592/image-size/large?v=v2&amp;amp;px=999" role="button" title="ExQ1.png" alt="ExQ1.png" /&gt;&lt;/span&gt;Any guesses as to why the categories for the graphs are so wonky?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 22:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorrect-Display-Proc-Chart-Group-from-Proc-Format/m-p/436911#M108723</guid>
      <dc:creator>vsl2000</dc:creator>
      <dc:date>2018-02-13T22:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Display Proc Chart Group from Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorrect-Display-Proc-Chart-Group-from-Proc-Format/m-p/436931#M108731</link>
      <description>&lt;P&gt;I haven't seen Proc Chart code in more than 25 years.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By "wonky" I am guessing that you refer to axis appearance.&lt;/P&gt;
&lt;P&gt;The first chart, for Q1, the procedure is guessing how many axis values and has created bins that center on those displayed values, only two of which center on a value defined in the discrete format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the second, for Q3, the axis is being treated as discrete numeric values and repeating the range format that is used for each discrete value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add the AXIS option to indicate where you want your tick marks and DISCRETE if you want each value displayed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there some specific reason you are using Chart instead of SGPLOT or Gchart&amp;nbsp;either of which will create groups based on formatted values?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 23:58:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorrect-Display-Proc-Chart-Group-from-Proc-Format/m-p/436931#M108731</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-02-13T23:58:37Z</dc:date>
    </item>
  </channel>
</rss>

