<?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: 'ALL '    variable label in PROC TABULATE based on Subgroups in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/ALL-variable-label-in-PROC-TABULATE-based-on-Subgroups/m-p/60524#M17148</link>
    <description>If I understand correctly, you wish to label an ALL total (or sub-total) cell.&lt;BR /&gt;
That feature has been available in the TABULATE Procedure for .... (alongtime=&amp;gt;10yrs)&lt;BR /&gt;
&lt;BR /&gt;
table ( &amp;amp;type1 all="&amp;amp;type1 totals"), ( all= 'row total' &amp;amp;type2=' ' )&lt;BR /&gt;
     &lt;BR /&gt;
as demonstrated below, key words like ALL and statistics like SUM and N can be labelled "in context" inside the TABLE statement. It should be in the manual [pre]proc tabulate data= sashelp.class ;&lt;BR /&gt;
  %let type1 = age ;&lt;BR /&gt;
  %let type2 = sex ;&lt;BR /&gt;
   class &amp;amp;type1 &amp;amp;type2  ;&lt;BR /&gt;
   table ( &amp;amp;type1 all="&amp;amp;type1 totals")&lt;BR /&gt;
        , ( all= 'row total' &amp;amp;type2=' ' )&lt;BR /&gt;
          * n=' ' *f= comma5.0&lt;BR /&gt;
        / box= 'cross counting sashelp.class'&lt;BR /&gt;
          rts= 20 ;&lt;BR /&gt;
run ; [/pre]</description>
    <pubDate>Fri, 31 Jul 2009 14:03:30 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2009-07-31T14:03:30Z</dc:date>
    <item>
      <title>'ALL '    variable label in PROC TABULATE based on Subgroups</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ALL-variable-label-in-PROC-TABULATE-based-on-Subgroups/m-p/60521#M17145</link>
      <description>Hi ,&lt;BR /&gt;
&lt;BR /&gt;
         Is there a way in PROC TABULATE to  label the ALL  variable used for subgroup totals  according to the name of the Subgroup? For e.g. if there are two  Subgroups in the PROC TABULATE  namely A and B , then is it possible to label the ALL variable for these groups as "Subtotals for A"   and "Subtotals for B" respectively instead labeling them with the same name like "Subtotals" as is done usually.</description>
      <pubDate>Thu, 30 Jul 2009 19:00:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ALL-variable-label-in-PROC-TABULATE-based-on-Subgroups/m-p/60521#M17145</guid>
      <dc:creator>pchegoor</dc:creator>
      <dc:date>2009-07-30T19:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: 'ALL '    variable label in PROC TABULATE based on Subgroups</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ALL-variable-label-in-PROC-TABULATE-based-on-Subgroups/m-p/60522#M17146</link>
      <description>You might have to use proc report for that.</description>
      <pubDate>Thu, 30 Jul 2009 23:11:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ALL-variable-label-in-PROC-TABULATE-based-on-Subgroups/m-p/60522#M17146</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2009-07-30T23:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: 'ALL '    variable label in PROC TABULATE based on Subgroups</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ALL-variable-label-in-PROC-TABULATE-based-on-Subgroups/m-p/60523#M17147</link>
      <description>Thanks Chris.Will use PROC REPORT . I hope SAS provides this option to the ALL variable of PROC TABULATE in future versions.</description>
      <pubDate>Thu, 30 Jul 2009 23:26:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ALL-variable-label-in-PROC-TABULATE-based-on-Subgroups/m-p/60523#M17147</guid>
      <dc:creator>pchegoor</dc:creator>
      <dc:date>2009-07-30T23:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: 'ALL '    variable label in PROC TABULATE based on Subgroups</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ALL-variable-label-in-PROC-TABULATE-based-on-Subgroups/m-p/60524#M17148</link>
      <description>If I understand correctly, you wish to label an ALL total (or sub-total) cell.&lt;BR /&gt;
That feature has been available in the TABULATE Procedure for .... (alongtime=&amp;gt;10yrs)&lt;BR /&gt;
&lt;BR /&gt;
table ( &amp;amp;type1 all="&amp;amp;type1 totals"), ( all= 'row total' &amp;amp;type2=' ' )&lt;BR /&gt;
     &lt;BR /&gt;
as demonstrated below, key words like ALL and statistics like SUM and N can be labelled "in context" inside the TABLE statement. It should be in the manual [pre]proc tabulate data= sashelp.class ;&lt;BR /&gt;
  %let type1 = age ;&lt;BR /&gt;
  %let type2 = sex ;&lt;BR /&gt;
   class &amp;amp;type1 &amp;amp;type2  ;&lt;BR /&gt;
   table ( &amp;amp;type1 all="&amp;amp;type1 totals")&lt;BR /&gt;
        , ( all= 'row total' &amp;amp;type2=' ' )&lt;BR /&gt;
          * n=' ' *f= comma5.0&lt;BR /&gt;
        / box= 'cross counting sashelp.class'&lt;BR /&gt;
          rts= 20 ;&lt;BR /&gt;
run ; [/pre]</description>
      <pubDate>Fri, 31 Jul 2009 14:03:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ALL-variable-label-in-PROC-TABULATE-based-on-Subgroups/m-p/60524#M17148</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-07-31T14:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: 'ALL '    variable label in PROC TABULATE based on Subgroups</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ALL-variable-label-in-PROC-TABULATE-based-on-Subgroups/m-p/60525#M17149</link>
      <description>Thanks for your reply Peter, I actually meant to label the ALL variable within the same dimension of the table based upon the group.For eg if the Age Variable had two subgroups eg 'Young'  and 'Old'   then i wanted the subtotals for these subgroups to be labeled as "Subtotals for the Young"  and Subtotals for the Old" .Anyway i guess i will use PROC REPORT for now.

Message was edited by: pchegoor</description>
      <pubDate>Fri, 31 Jul 2009 18:52:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ALL-variable-label-in-PROC-TABULATE-based-on-Subgroups/m-p/60525#M17149</guid>
      <dc:creator>pchegoor</dc:creator>
      <dc:date>2009-07-31T18:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: 'ALL '    variable label in PROC TABULATE based on Subgroups</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ALL-variable-label-in-PROC-TABULATE-based-on-Subgroups/m-p/60526#M17150</link>
      <description>Tabulate labelling information for classLevel and classValue don't join up anywhere. &lt;BR /&gt;
Pre-processing could do some of it. &lt;BR /&gt;
Replacing the "all" line/cells with a "total" observation containing the required statistics and for the classValue, it would hold the parent classValue and/or a concatenation of all its parent classValues in the table hierarchy. &lt;BR /&gt;
Proc means does summarise at the intermediate levels. &lt;BR /&gt;
Very similarly to the Proc Tabulate TABLE statement, you can layout the cross-classing you want with the TYPES statement of Proc Means. &lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a000222729.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a000222729.htm&lt;/A&gt;. Apart from the NWAY level each value of _TYPE_ is a subtotal. &lt;BR /&gt;
More convenient than the traditional _TYPE_, with the proc means CHARTYPE option, the _TYPE_ variable becomes character in a binary style that holds 1 for each relevant class variable and 0 if that output row is a total of that class variable.&lt;BR /&gt;
 Without knowing too much about the class variables, you can use the "1" s in _TYPE_ to signify which class values represent the 'parent' of the current summary line. For each output row from proc means which has a '0' in _TYPE_ you need to replace the blank value of the corresponding class variable, with the string you want to take the place of ALL. In the general approach I'm proposing, the value to replace ALL, will be a character string that is a concatenation of the relevant class variables (those which have a '1' in _TYPE_). &lt;BR /&gt;
Of course, once this is used as the input to proc tabulate, you won't be able to use the N statistic (an N-statistic or _FREQ_ from proc means should provide the count). &lt;BR /&gt;
Nor would you use the ALL keyword, because that row is already in the output from proc means. &lt;BR /&gt;
As proc means output is generated in _TYPE_ order, you would need to create some way of re-ordering the data - most important is whether you want the ALL statistics to come after or before the relevant class group.&lt;BR /&gt;
Another inconvenience to overcome: numeric class values would need to be converted to character types to allow the replacement of ALL with the parent class value concatenation.&lt;BR /&gt;
 &lt;BR /&gt;
Guess by this stage I'm convinced that PROC REPORT has won over TABULATE in this "battle of the reporting giants" better presented in the paper "SUGI 27: Battle of the Titans: REPORT vs. TABULATE" at &lt;A href="http://www2.sas.com/proceedings/sugi27/p133-27.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi27/p133-27.pdf&lt;/A&gt; .&lt;BR /&gt;
 &lt;BR /&gt;
  PeterC</description>
      <pubDate>Sat, 01 Aug 2009 09:30:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ALL-variable-label-in-PROC-TABULATE-based-on-Subgroups/m-p/60526#M17150</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-08-01T09:30:51Z</dc:date>
    </item>
  </channel>
</rss>

