<?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 Rows and columns in the table for Sensitivity calculation are in reversed order in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Rows-and-columns-in-the-table-for-Sensitivity-calculation-are-in/m-p/833022#M35741</link>
    <description>&lt;P&gt;In my dataset I have two variables, Test and Standard. Both have two options, Pos and Neg. When I run the following SAS code then the output table shows Pos and Neg in reverse order, so results are reversed. How can I fix it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc freq data=have;&lt;/P&gt;
&lt;P&gt;tables Test*Standard/senspec;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get the following table as output&lt;/P&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="25%"&gt;Neg&lt;/TD&gt;
&lt;TD width="25%"&gt;Pos&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;Neg&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;Pos&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="25%"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want the following table as output&lt;/P&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="25%"&gt;Pos&lt;/TD&gt;
&lt;TD width="25%"&gt;Neg&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;Pos&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;Neg&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
    <pubDate>Tue, 13 Sep 2022 00:32:26 GMT</pubDate>
    <dc:creator>Barkat</dc:creator>
    <dc:date>2022-09-13T00:32:26Z</dc:date>
    <item>
      <title>Rows and columns in the table for Sensitivity calculation are in reversed order</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Rows-and-columns-in-the-table-for-Sensitivity-calculation-are-in/m-p/833022#M35741</link>
      <description>&lt;P&gt;In my dataset I have two variables, Test and Standard. Both have two options, Pos and Neg. When I run the following SAS code then the output table shows Pos and Neg in reverse order, so results are reversed. How can I fix it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc freq data=have;&lt;/P&gt;
&lt;P&gt;tables Test*Standard/senspec;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get the following table as output&lt;/P&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="25%"&gt;Neg&lt;/TD&gt;
&lt;TD width="25%"&gt;Pos&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;Neg&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;Pos&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="25%"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want the following table as output&lt;/P&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="25%"&gt;Pos&lt;/TD&gt;
&lt;TD width="25%"&gt;Neg&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;Pos&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;Neg&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Tue, 13 Sep 2022 00:32:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Rows-and-columns-in-the-table-for-Sensitivity-calculation-are-in/m-p/833022#M35741</guid>
      <dc:creator>Barkat</dc:creator>
      <dc:date>2022-09-13T00:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Rows and columns in the table for Sensitivity calculation are in reversed order</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Rows-and-columns-in-the-table-for-Sensitivity-calculation-are-in/m-p/833042#M35750</link>
      <description>&lt;P&gt;N comes before P alphabetically. So that is the default order you will get from the output of Proc Freq.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the order is that important try:&lt;/P&gt;
&lt;PRE&gt;Proc sort data=have;
   by descending test descending standard;
run;

Proc freq data=have order=data;
   tables test*standard;
run;

&lt;/PRE&gt;
&lt;P&gt;The sort places Pos before Neg and the Proc Freq option order=data tells SAS to display data in the order encountered in the data set instead of the default internal order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another approach is to create numeric variables with the value 1= first to display, 2= second to display and so on. Then create a custom format to display the desired text. Use that format in Proc Freq. By default the order would be the internal 1, 2, 3 (etc) but the formatted value will appear.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 16:24:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Rows-and-columns-in-the-table-for-Sensitivity-calculation-are-in/m-p/833042#M35750</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-09-13T16:24:54Z</dc:date>
    </item>
  </channel>
</rss>

