<?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 proc freq to create 2 way freq table-control Order of rows +order of columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-to-create-2-way-freq-table-control-Order-of-rows-order/m-p/585560#M167003</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I am using proc freq to create 2 way freq table.&lt;/P&gt;
&lt;P&gt;The problem is that I want to control the following issues:&lt;/P&gt;
&lt;P&gt;1-Order of&amp;nbsp; rows&amp;nbsp; will be by the total freq of each category of&amp;nbsp; field&amp;nbsp;Z2&lt;/P&gt;
&lt;P&gt;2-Order of columns will be be order of numbers in field Z1: 2 3 4 5 6&lt;/P&gt;
&lt;P&gt;When I use order=freq then order of rows is correct but order of columns (Z2 categories) is not as I want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data rawdata;
input ID  Z1  Z2 $;
cards;
1 2 xjfjjj
2 3 djdjdj
3 3 xjfjjj
4 4 djdjdj
5 5 xjfjjj
6 5 djdjdj
7 6 djdjdj
8 6 asasas
9 6 asasas
10 6 djdjdj
;
run;


PROC FREQ DATA=rawdata order=freq ;
TABLE  Z2* Z1/ MISSING NOPERCENT NOCOL  norow   ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Sep 2019 09:30:43 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2019-09-02T09:30:43Z</dc:date>
    <item>
      <title>proc freq to create 2 way freq table-control Order of rows +order of columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-to-create-2-way-freq-table-control-Order-of-rows-order/m-p/585560#M167003</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I am using proc freq to create 2 way freq table.&lt;/P&gt;
&lt;P&gt;The problem is that I want to control the following issues:&lt;/P&gt;
&lt;P&gt;1-Order of&amp;nbsp; rows&amp;nbsp; will be by the total freq of each category of&amp;nbsp; field&amp;nbsp;Z2&lt;/P&gt;
&lt;P&gt;2-Order of columns will be be order of numbers in field Z1: 2 3 4 5 6&lt;/P&gt;
&lt;P&gt;When I use order=freq then order of rows is correct but order of columns (Z2 categories) is not as I want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data rawdata;
input ID  Z1  Z2 $;
cards;
1 2 xjfjjj
2 3 djdjdj
3 3 xjfjjj
4 4 djdjdj
5 5 xjfjjj
6 5 djdjdj
7 6 djdjdj
8 6 asasas
9 6 asasas
10 6 djdjdj
;
run;


PROC FREQ DATA=rawdata order=freq ;
TABLE  Z2* Z1/ MISSING NOPERCENT NOCOL  norow   ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 09:30:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-to-create-2-way-freq-table-control-Order-of-rows-order/m-p/585560#M167003</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-09-02T09:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq to create 2 way freq table-control Order of rows +order of columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-to-create-2-way-freq-table-control-Order-of-rows-order/m-p/585606#M167032</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data rawdata;
input ID  Z1  Z2 $;
cards;
1 2 xjfjjj
2 3 djdjdj
3 3 xjfjjj
4 4 djdjdj
5 5 xjfjjj
6 5 djdjdj
7 6 djdjdj
8 6 asasas
9 6 asasas
10 6 djdjdj
;
run;


PROC tabulate DATA=rawdata  ;
class z2/order=freq;
class z1/order=internal;
TABLE  z2=' ' all,z1*n*f=8.0 all*n*f=8.0/printmiss box='z2' misstext='0';
keylabel n=' ';
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Sep 2019 12:42:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-to-create-2-way-freq-table-control-Order-of-rows-order/m-p/585606#M167032</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-09-02T12:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq to create 2 way freq table-control Order of rows +order of columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-to-create-2-way-freq-table-control-Order-of-rows-order/m-p/585682#M167081</link>
      <description>&lt;P&gt;It is perfect and thank you for the solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to ask please what is the way to do it via proc freq.&lt;/P&gt;
&lt;P&gt;When I use "order=freq "&amp;nbsp; then I control the order of the rows but why the order of the columns(Var Z1) is changed?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 03:17:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-to-create-2-way-freq-table-control-Order-of-rows-order/m-p/585682#M167081</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-09-03T03:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq to create 2 way freq table-control Order of rows +order of columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-to-create-2-way-freq-table-control-Order-of-rows-order/m-p/585784#M167141</link>
      <description>&lt;P&gt;I think it is hard for PROC FREQ . Maybe somebody could shed a light .&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 11:57:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-to-create-2-way-freq-table-control-Order-of-rows-order/m-p/585784#M167141</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-09-03T11:57:35Z</dc:date>
    </item>
  </channel>
</rss>

