<?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: x= y= or category= response= in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/x-y-or-category-response/m-p/923779#M24535</link>
    <description>&lt;P&gt;CATEGORY and RESPONSE are the documented options, so while X and Y might work, I would stick with the supported syntax that is in the documentation.&amp;nbsp;&amp;nbsp;&lt;A id="_cahl_link" href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatgraph/n1dlakkx61v72in1k3ebm8rz18qd.htm" target="_blank"&gt;SAS Help Center: BARCHART&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Apr 2024 12:15:24 GMT</pubDate>
    <dc:creator>LeliaM</dc:creator>
    <dc:date>2024-04-10T12:15:24Z</dc:date>
    <item>
      <title>x= y= or category= response=</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/x-y-or-category-response/m-p/923770#M24533</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The two barchart statements give the same result.&lt;/P&gt;
&lt;P&gt;In the first one x= and y= are used.&lt;/P&gt;
&lt;P&gt;In the second one, category= and response= are used.&lt;/P&gt;
&lt;P&gt;Similar possibilities occur for other graphs like piechart.&lt;/P&gt;
&lt;P&gt;Which one should be preferred? I guess there are some historical reason for one or the other but I have no clue which one was introduced first or last.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
    define statgraph xxbarchart;
    begingraph;

        layout overlay;
            barchart category=age response=frequency;
        endlayout;
        
    endgraph;
    end;
run;

proc template;
    define statgraph yybarchart;
    begingraph;

        layout overlay;
            barchart x=age y=frequency;         
        endlayout;
        
    endgraph;
    end;
run;


ods exclude CrossTabFreqs;
ods output CrossTabFreqs=class_stat (keep=sex age frequency _type_ 
                                     where=(_type_='11'));

proc freq data=sashelp.class;
    table sex*age;
run;

proc sgrender data=class_stat template=xxbarchart;
run;

proc sgrender data=class_stat template=yybarchart;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Apr 2024 10:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/x-y-or-category-response/m-p/923770#M24533</guid>
      <dc:creator>xxformat_com</dc:creator>
      <dc:date>2024-04-10T10:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: x= y= or category= response=</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/x-y-or-category-response/m-p/923779#M24535</link>
      <description>&lt;P&gt;CATEGORY and RESPONSE are the documented options, so while X and Y might work, I would stick with the supported syntax that is in the documentation.&amp;nbsp;&amp;nbsp;&lt;A id="_cahl_link" href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatgraph/n1dlakkx61v72in1k3ebm8rz18qd.htm" target="_blank"&gt;SAS Help Center: BARCHART&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 12:15:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/x-y-or-category-response/m-p/923779#M24535</guid>
      <dc:creator>LeliaM</dc:creator>
      <dc:date>2024-04-10T12:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: x= y= or category= response=</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/x-y-or-category-response/m-p/923782#M24536</link>
      <description>&lt;P&gt;Lelia is right, the required data roles is CATEGORY.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If memory serves, waaay back in SAS 9.2, the required roles were X and Y, similar to other statements like SCATTERPLOT, etc.&amp;nbsp; However, to better support the "categorizing" behavior for BARCHART,&amp;nbsp; a change was made to make CATEGORY the only required role.&amp;nbsp; In this case,&amp;nbsp; the statement will summarize the data based frequency of category.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For backwards compatibility, an alternate was provided where one could specify both CATEGORY (or X) and RESPONSE (or Y) on the left of the '/'.&amp;nbsp; Also, the CATEGORY role can be treated both as discrete or interval.&amp;nbsp; Default is discrete, and each value is placed at equal interval.&amp;nbsp; But if a chart is desired where the values are placed on the correct scale of a linear or date variable, then TYPE= can be specified on the axisopts option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or, in the equivalent SGPLOT procedure, XAXIS TYPE=TIME can be specified as shown in the example below:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2015/08/12/bar-chart-on-interval-axis-sas-9-40m3/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2015/08/12/bar-chart-on-interval-axis-sas-9-40m3/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 12:38:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/x-y-or-category-response/m-p/923782#M24536</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2024-04-10T12:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: x= y= or category= response=</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/x-y-or-category-response/m-p/923791#M24537</link>
      <description>&lt;P&gt;Historical reasons is quite likely. SAS actually does a fair amount of work to make sure that code that worked in a previous version still "works" though some minor behaviors may change. You may get notes or warnings depending on specific code about some of these option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example some documentation directly related to your question (from my 9.4.7 online help):&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xisDoc-syntax"&gt;
&lt;DIV class="xisDoc-syntaxDescription"&gt;
&lt;DIV class="xisDoc-requiredArgGroup"&gt;
&lt;DIV id="p0bia8b5b93hy2n1r8ugufr5t6sh" class="xisDoc-argDescriptionPair"&gt;
&lt;H4 class="xisDoc-argument"&gt;CATEGORY=&lt;SPAN class="xisDoc-choice"&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;column&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN class="xisDoc-choice"&gt; | &lt;EM class="xisDoc-userSuppliedValue"&gt;expression&lt;/EM&gt;&lt;/SPAN&gt;&lt;/H4&gt;
&lt;DIV class="xisDoc-argumentDescription"&gt;
&lt;P&gt;&lt;SPAN class="xisDoc-shortDescription"&gt;specifies the column or expression for the category values.&lt;/SPAN&gt;&lt;/P&gt;
&lt;SECTION class="xisDoc-tableWrap"&gt;
&lt;TABLE class="xisDoc-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="xisDoc-summaryNote" rowspan="2"&gt;Notes&lt;/TH&gt;
&lt;TD class="xisDoc-summaryText"&gt;You can use X= as an alternative to CATEGORY=. If you use X=, then be aware that the TIP=, TIPFORMAT=, and TIPLABEL= options recognize X as the category role and not as CATEGORY.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/SECTION&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This tells me that if I were using the Tip, Tipformat or Tiblabel options then use of X= instead of Category= may yield some difference in output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will see in procedures places where you can specify an option with "alias" names. Sometimes these reflect an earlier version of the options for a procedure that has evolved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 14:00:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/x-y-or-category-response/m-p/923791#M24537</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-10T14:00:29Z</dc:date>
    </item>
  </channel>
</rss>

