<?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 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate/m-p/23798#M5314</link>
    <description>I've a complicated table to produce with several subgroups.  I have got so far by experimenting with the data formats etc but have  come to a blank and wondered if anyone could help me?&lt;BR /&gt;
&lt;BR /&gt;
The table format is...&lt;BR /&gt;
&lt;BR /&gt;
group     subgroup&lt;BR /&gt;
group1   subgroup1&lt;BR /&gt;
             subgroup2&lt;BR /&gt;
             subgroup3&lt;BR /&gt;
             all&lt;BR /&gt;
group2   subgroup1&lt;BR /&gt;
             subgroup2&lt;BR /&gt;
             subgroup3&lt;BR /&gt;
             all&lt;BR /&gt;
overall    subgroup1&lt;BR /&gt;
             subgroup2&lt;BR /&gt;
             subgroup3&lt;BR /&gt;
             all&lt;BR /&gt;
&lt;BR /&gt;
sorry about the spacing..&lt;BR /&gt;
&lt;BR /&gt;
I can get it to this except the subgroup label comes out for all groups and subgroups and I only want it at the top. The code I have used for ods output is&lt;BR /&gt;
&lt;BR /&gt;
proc tabulate data=all;&lt;BR /&gt;
class group subgroup1 subgroup2 subgroup3;&lt;BR /&gt;
classlev group subgroup1 subgroup2 subgroup3;&lt;BR /&gt;
var id var1 var2 var3 var4 var5;&lt;BR /&gt;
table (group='group' all=[label='Overall'])&lt;BR /&gt;
*(subgroup1='' subgroup2='' subgroup3='' all=[label='all']),&lt;BR /&gt;
(var1='var1' var2='var2' var3='var3' var4='var4' var5='var5')*(N=''*f=3.);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I can see one way to do this is to amend the subgroups to one super subgroup will all as part of it but want to use the raw data if possible.</description>
    <pubDate>Fri, 06 Jun 2008 10:00:06 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-06-06T10:00:06Z</dc:date>
    <item>
      <title>proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate/m-p/23798#M5314</link>
      <description>I've a complicated table to produce with several subgroups.  I have got so far by experimenting with the data formats etc but have  come to a blank and wondered if anyone could help me?&lt;BR /&gt;
&lt;BR /&gt;
The table format is...&lt;BR /&gt;
&lt;BR /&gt;
group     subgroup&lt;BR /&gt;
group1   subgroup1&lt;BR /&gt;
             subgroup2&lt;BR /&gt;
             subgroup3&lt;BR /&gt;
             all&lt;BR /&gt;
group2   subgroup1&lt;BR /&gt;
             subgroup2&lt;BR /&gt;
             subgroup3&lt;BR /&gt;
             all&lt;BR /&gt;
overall    subgroup1&lt;BR /&gt;
             subgroup2&lt;BR /&gt;
             subgroup3&lt;BR /&gt;
             all&lt;BR /&gt;
&lt;BR /&gt;
sorry about the spacing..&lt;BR /&gt;
&lt;BR /&gt;
I can get it to this except the subgroup label comes out for all groups and subgroups and I only want it at the top. The code I have used for ods output is&lt;BR /&gt;
&lt;BR /&gt;
proc tabulate data=all;&lt;BR /&gt;
class group subgroup1 subgroup2 subgroup3;&lt;BR /&gt;
classlev group subgroup1 subgroup2 subgroup3;&lt;BR /&gt;
var id var1 var2 var3 var4 var5;&lt;BR /&gt;
table (group='group' all=[label='Overall'])&lt;BR /&gt;
*(subgroup1='' subgroup2='' subgroup3='' all=[label='all']),&lt;BR /&gt;
(var1='var1' var2='var2' var3='var3' var4='var4' var5='var5')*(N=''*f=3.);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I can see one way to do this is to amend the subgroups to one super subgroup will all as part of it but want to use the raw data if possible.</description>
      <pubDate>Fri, 06 Jun 2008 10:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate/m-p/23798#M5314</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-06-06T10:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate/m-p/23799#M5315</link>
      <description>Hi:&lt;BR /&gt;
  I don't quite see what you mean by "subgroup label comes out for all groups and subgroups and I only want it at the top". When I use your code with some dummy data, I get the table shown below. Do you mean the word "group" or the word "all" or the word "Overall" in the table below. Or, do you want to make the top row header with "group" disappear entirely and place some information in the BOX area (above the row header area line)????&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
------------------------------------------------------------&lt;BR /&gt;
|                       | var1 | var2 | var3 | var4 | var5 |&lt;BR /&gt;
|-----------------------+------+------+------+------+------|&lt;BR /&gt;
|group      |           |      |      |      |      |      |&lt;BR /&gt;
|-----------+-----------|      |      |      |      |      |&lt;BR /&gt;
|CANADA     |EAST       |    96|    96|    96|    96|    96|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |WEST       |    96|    96|    96|    96|    96|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |FURNITURE  |    96|    96|    96|    96|    96|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |OFFICE     |    96|    96|    96|    96|    96|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |CHAIR      |    96|    96|    96|    96|    96|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |SOFA       |    96|    96|    96|    96|    96|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |all        |   192|   192|   192|   192|   192|&lt;BR /&gt;
|-----------+-----------+------+------+------+------+------|&lt;BR /&gt;
|GERMANY    |EAST       |    96|    96|    96|    96|    96|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |WEST       |    96|    96|    96|    96|    96|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |FURNITURE  |    96|    96|    96|    96|    96|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |OFFICE     |    96|    96|    96|    96|    96|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |CHAIR      |    96|    96|    96|    96|    96|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |SOFA       |    96|    96|    96|    96|    96|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |all        |   192|   192|   192|   192|   192|&lt;BR /&gt;
|-----------+-----------+------+------+------+------+------|&lt;BR /&gt;
|Overall    |EAST       |   192|   192|   192|   192|   192|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |WEST       |   192|   192|   192|   192|   192|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |FURNITURE  |   192|   192|   192|   192|   192|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |OFFICE     |   192|   192|   192|   192|   192|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |CHAIR      |   192|   192|   192|   192|   192|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |SOFA       |   192|   192|   192|   192|   192|&lt;BR /&gt;
|           |-----------+------+------+------+------+------|&lt;BR /&gt;
|           |all        |   384|   384|   384|   384|   384|&lt;BR /&gt;
------------------------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 06 Jun 2008 17:52:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate/m-p/23799#M5315</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-06-06T17:52:13Z</dc:date>
    </item>
  </channel>
</rss>

