<?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 Tabulate Question in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Question/m-p/47239#M12660</link>
    <description>Dear All,&lt;BR /&gt;
&lt;BR /&gt;
I had difficulty creating a 2-D table using proc tabulate:&lt;BR /&gt;
&lt;BR /&gt;
________________I_______________II_____________________ALL____&lt;BR /&gt;
&lt;BR /&gt;
ALL____________N_______________N____________________N_______&lt;BR /&gt;
&lt;BR /&gt;
COMP(b)_______N_(COLPCTN)____N_(COLPCTN)_____N_(COLPCTN)___&lt;BR /&gt;
&lt;BR /&gt;
DSC&lt;BR /&gt;
   1___________N_(COLPCTN)_____N_(COLPCTN)_____N_(COLPCTN)___&lt;BR /&gt;
   2___________N_(COLPCTN)_____N_(COLPCTN)_____N_(COLPCTN)___&lt;BR /&gt;
   ....&lt;BR /&gt;
   6___________N_(COLPCTN)_____N_(COLPCTN)_____N_(COLPCTN)___&lt;BR /&gt;
&lt;BR /&gt;
Say 'comp' is a class, it has two categories 'a' and 'b'. Under category 'a' there is another class called 'dsc' which has 6 categories. The table will include summary(N, COLPCTN) for category 'b' in 'comp' in one row, and it also include summary for each subgroup in 'dsc' but not the summary for 'a' in 'comp' in following rows. How to do the table operation to achieve this? And is there any way to put N and COLPCTN in the same cell with a parenthesis around COLPCTN?&lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
    <pubDate>Mon, 22 Jun 2009 02:52:12 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-06-22T02:52:12Z</dc:date>
    <item>
      <title>Proc Tabulate Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Question/m-p/47239#M12660</link>
      <description>Dear All,&lt;BR /&gt;
&lt;BR /&gt;
I had difficulty creating a 2-D table using proc tabulate:&lt;BR /&gt;
&lt;BR /&gt;
________________I_______________II_____________________ALL____&lt;BR /&gt;
&lt;BR /&gt;
ALL____________N_______________N____________________N_______&lt;BR /&gt;
&lt;BR /&gt;
COMP(b)_______N_(COLPCTN)____N_(COLPCTN)_____N_(COLPCTN)___&lt;BR /&gt;
&lt;BR /&gt;
DSC&lt;BR /&gt;
   1___________N_(COLPCTN)_____N_(COLPCTN)_____N_(COLPCTN)___&lt;BR /&gt;
   2___________N_(COLPCTN)_____N_(COLPCTN)_____N_(COLPCTN)___&lt;BR /&gt;
   ....&lt;BR /&gt;
   6___________N_(COLPCTN)_____N_(COLPCTN)_____N_(COLPCTN)___&lt;BR /&gt;
&lt;BR /&gt;
Say 'comp' is a class, it has two categories 'a' and 'b'. Under category 'a' there is another class called 'dsc' which has 6 categories. The table will include summary(N, COLPCTN) for category 'b' in 'comp' in one row, and it also include summary for each subgroup in 'dsc' but not the summary for 'a' in 'comp' in following rows. How to do the table operation to achieve this? And is there any way to put N and COLPCTN in the same cell with a parenthesis around COLPCTN?&lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
      <pubDate>Mon, 22 Jun 2009 02:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Question/m-p/47239#M12660</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-06-22T02:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Question/m-p/47240#M12661</link>
      <description>Something like this?&lt;BR /&gt;
[pre]data MIMIC;&lt;BR /&gt;
  set SASHELP.PRDSALE(where=(PRODUCT ne 'SOFA'));&lt;BR /&gt;
proc format;  &lt;BR /&gt;
  value $prodtyp (default=12) 'BED' =' FURNITURE';&lt;BR /&gt;
proc tabulate order=formated;&lt;BR /&gt;
  class PRODUCT COUNTRY;&lt;BR /&gt;
  table all PRODUCT='', COUNTRY*(n colpctn)*f=comma8.0;&lt;BR /&gt;
  format PRODUCT $prodtyp.;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Only one stat per cell in the tabulate procedure.&lt;BR /&gt;
Since you only want only one left-hand class column, you must choose between displaying 2 variables in a row&lt;BR /&gt;
[pre]table all PRODTYPE='' PRODUCT=''[/pre]which requires massaging the data before hand, &lt;BR /&gt;
or displaying one variable and masking it by using a format, which I did.</description>
      <pubDate>Mon, 22 Jun 2009 23:28:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Question/m-p/47240#M12661</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2009-06-22T23:28:40Z</dc:date>
    </item>
  </channel>
</rss>

