<?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 Exclude one or more variable´s options from output in proc tabulate in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exclude-one-or-more-variable-s-options-from-output-in-proc/m-p/6567#M2561</link>
    <description>Hello, My doubt is the follow. I have one question (variable) that has three option.&lt;BR /&gt;
I´d like to calculate the percentage of firms by region that mark option "1".&lt;BR /&gt;
 This I can do, but I dind´t get that the other two option are exclude of output.&lt;BR /&gt;
The example below illustrate the case.&lt;BR /&gt;
&lt;BR /&gt;
Instead of &lt;BR /&gt;
REGIONS (RG)-----------------Q176----------------ALL&lt;BR /&gt;
--------------------------------1----------2------------3	&lt;BR /&gt;
--------------------------------%---------%----------%-----N&lt;BR /&gt;
SUDESTE---------------50.0-------50.0-------0.0----2&lt;BR /&gt;
NORDESTE-----------100.0--------0.0-------0.0----1&lt;BR /&gt;
CENTRO-OESTE-------0.0--------0.0----100.0----1&lt;BR /&gt;
SUL-----------------------100.0-------0.0--------0.0----1&lt;BR /&gt;
ALL--------------------------60.0-----20.0------20.0----5&lt;BR /&gt;
&lt;BR /&gt;
I would like &lt;BR /&gt;
REGIONS (RG)------Q176----------ALL&lt;BR /&gt;
--------------------------------1----------	&lt;BR /&gt;
--------------------------------%------------N&lt;BR /&gt;
SUDESTE---------------50.0-----------2&lt;BR /&gt;
NORDESTE-----------100.0-----------1&lt;BR /&gt;
CENTRO-OESTE-------0.0-----------1&lt;BR /&gt;
SUL-----------------------100.0-----------1&lt;BR /&gt;
ALL--------------------------60.0----------5&lt;BR /&gt;
&lt;BR /&gt;
Sincerely&lt;BR /&gt;
&lt;BR /&gt;
Edmundo</description>
    <pubDate>Sun, 27 Jan 2008 22:36:22 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-01-27T22:36:22Z</dc:date>
    <item>
      <title>Exclude one or more variable´s options from output in proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exclude-one-or-more-variable-s-options-from-output-in-proc/m-p/6567#M2561</link>
      <description>Hello, My doubt is the follow. I have one question (variable) that has three option.&lt;BR /&gt;
I´d like to calculate the percentage of firms by region that mark option "1".&lt;BR /&gt;
 This I can do, but I dind´t get that the other two option are exclude of output.&lt;BR /&gt;
The example below illustrate the case.&lt;BR /&gt;
&lt;BR /&gt;
Instead of &lt;BR /&gt;
REGIONS (RG)-----------------Q176----------------ALL&lt;BR /&gt;
--------------------------------1----------2------------3	&lt;BR /&gt;
--------------------------------%---------%----------%-----N&lt;BR /&gt;
SUDESTE---------------50.0-------50.0-------0.0----2&lt;BR /&gt;
NORDESTE-----------100.0--------0.0-------0.0----1&lt;BR /&gt;
CENTRO-OESTE-------0.0--------0.0----100.0----1&lt;BR /&gt;
SUL-----------------------100.0-------0.0--------0.0----1&lt;BR /&gt;
ALL--------------------------60.0-----20.0------20.0----5&lt;BR /&gt;
&lt;BR /&gt;
I would like &lt;BR /&gt;
REGIONS (RG)------Q176----------ALL&lt;BR /&gt;
--------------------------------1----------	&lt;BR /&gt;
--------------------------------%------------N&lt;BR /&gt;
SUDESTE---------------50.0-----------2&lt;BR /&gt;
NORDESTE-----------100.0-----------1&lt;BR /&gt;
CENTRO-OESTE-------0.0-----------1&lt;BR /&gt;
SUL-----------------------100.0-----------1&lt;BR /&gt;
ALL--------------------------60.0----------5&lt;BR /&gt;
&lt;BR /&gt;
Sincerely&lt;BR /&gt;
&lt;BR /&gt;
Edmundo</description>
      <pubDate>Sun, 27 Jan 2008 22:36:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exclude-one-or-more-variable-s-options-from-output-in-proc/m-p/6567#M2561</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-01-27T22:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude one or more variable´s options from output in proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exclude-one-or-more-variable-s-options-from-output-in-proc/m-p/6568#M2562</link>
      <description>tabulate will do this if you have a little pre-processing which generates a variable =1 where the answer chosen was 1(else =0). Perhaps [pre]&lt;BR /&gt;
data prepare/view=prepare ;&lt;BR /&gt;
  set answers ; * your original data set of answers ;&lt;BR /&gt;
   q176_1 = (q176=1) ;&lt;BR /&gt;
   q176_2 = (q176=2) ;&lt;BR /&gt;
   q176_3 = (q176=3) ;&lt;BR /&gt;
run;&lt;BR /&gt;
proc tabulate data= prepare ;&lt;BR /&gt;
  var   q176_1 ;&lt;BR /&gt;
  class region ;&lt;BR /&gt;
  table ( region all), q176_1='Q176' * pctsum='1' * f=5.2 &lt;BR /&gt;
                       n='all'*f=7. &lt;BR /&gt;
       / rts= 20 ;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 28 Jan 2008 10:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exclude-one-or-more-variable-s-options-from-output-in-proc/m-p/6568#M2562</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-01-28T10:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude one or more variable´s options from output in proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exclude-one-or-more-variable-s-options-from-output-in-proc/m-p/6569#M2563</link>
      <description>Thank you Peter, but I still have one problem with the percentage row column and total column.&lt;BR /&gt;
These two columns was not calculate in a proper way. Look example below.&lt;BR /&gt;
&lt;BR /&gt;
Right table&lt;BR /&gt;
&lt;BR /&gt;
Region--------------------------------------(Q174)&lt;BR /&gt;
-------------------------------------1---------------------2------------------------Total&lt;BR /&gt;
------------------------n------%C------%L-----n-----%C------%L-------n------%C-----%L&lt;BR /&gt;
Sudeste------------1------33,3----33.3-----2-----100,0----66.7----3------60,0---100.0&lt;BR /&gt;
Centro-oeste-----1------33,3---100.0------.---------.---------.-------1------20,0---100.0&lt;BR /&gt;
Sul-------------------1------33,3---100.0------.---------.---------. ------1------20,0---100.0&lt;BR /&gt;
Total----------------3-----100,0-----60.0-----2----100,0----40.0-----5----100,0---100.0&lt;BR /&gt;
&lt;BR /&gt;
I´d like to exclude the option 2, but remain the percentage calculus over all 5 observations.&lt;BR /&gt;
&lt;BR /&gt;
Region------------------------(Q174)&lt;BR /&gt;
-------------------------------------1-------------------Total&lt;BR /&gt;
------------------------n--------%C------%L-------n-----% C----%L&lt;BR /&gt;
Sudeste-------------1-------33,3-----33.3------3-----60,0---100.0&lt;BR /&gt;
Centro-oeste-------1------33,3----100.0------1-----20,0---100.0&lt;BR /&gt;
Sul--------------------1-------33,3----100.0------1-----20,0---100.0&lt;BR /&gt;
Total-----------------3------100,0-----60.0------5----100,0---100.0&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Sincerely&lt;BR /&gt;
&lt;BR /&gt;
Edmundo</description>
      <pubDate>Mon, 28 Jan 2008 19:04:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exclude-one-or-more-variable-s-options-from-output-in-proc/m-p/6569#M2563</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-01-28T19:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude one or more variable´s options from output in proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exclude-one-or-more-variable-s-options-from-output-in-proc/m-p/6570#M2564</link>
      <description>sorry, out of practise - I forgot the important feature to mention and demo :&lt;BR /&gt;
A percentage can be derived as [pre]&lt;BR /&gt;
       sum( of analysis varA )&lt;BR /&gt;
100 * --------------------------- &lt;BR /&gt;
       sum( of analysis varB )[/pre] with small change like: [pre]&lt;BR /&gt;
data prepare/view=prepare ;&lt;BR /&gt;
   set answers ; &lt;BR /&gt;
   * your original data set of answers ;   &lt;BR /&gt;
   q176_1 = (q176=1) ;&lt;BR /&gt;
   q176_2 = (q176=2) ;&lt;BR /&gt;
   q176_3 = (q176=3) ;&lt;BR /&gt;
   retain one 1 ;&lt;BR /&gt;
run;&lt;BR /&gt;
proc tabulate data= prepare ;&lt;BR /&gt;
  var   q176_1 one;&lt;BR /&gt;
  class region ;&lt;BR /&gt;
  table ( region all), q176_1='Q176' &lt;BR /&gt;
                     * pctsum&lt;ONE&gt;='1' * f=5.2&lt;BR /&gt;
                       n='all'*f=7.&lt;BR /&gt;
        / rts= 20 ;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre] try that approach....&lt;BR /&gt;
At the back of my mind I feel the introduction of the "one" variable should be unneccessary, perhaps using pctn. &lt;BR /&gt;
However, the important addition here is that using an analysis variable as percentage denominator definition, gives you a ratio of two analysis variables instead of the summary of each value of the class variable.&lt;BR /&gt;
 &lt;BR /&gt;
Good Luck&lt;BR /&gt;
&lt;BR /&gt;
Peter-c&lt;/ONE&gt;</description>
      <pubDate>Tue, 29 Jan 2008 09:55:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exclude-one-or-more-variable-s-options-from-output-in-proc/m-p/6570#M2564</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-01-29T09:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude one or more variable´s options from output in proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exclude-one-or-more-variable-s-options-from-output-in-proc/m-p/6571#M2565</link>
      <description>Many thanks Peter, you did it. Your approach work well.&lt;BR /&gt;
&lt;BR /&gt;
You have a deep knowledge about SAS indeed.&lt;BR /&gt;
&lt;BR /&gt;
sincerely&lt;BR /&gt;
&lt;BR /&gt;
Edmundo</description>
      <pubDate>Tue, 29 Jan 2008 18:27:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exclude-one-or-more-variable-s-options-from-output-in-proc/m-p/6571#M2565</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-01-29T18:27:12Z</dc:date>
    </item>
  </channel>
</rss>

