<?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 percentages in tabulate in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/percentages-in-tabulate/m-p/60735#M17217</link>
    <description>i have a tabulate with below output. i want the numbers to be represented as a percentage of "All". is there an easier way to do this apart from a proc summary and merge?&lt;BR /&gt;
                              |         Broken                 |          Kept                   |            |&lt;BR /&gt;
|                             |------------------------------------+-----------------------------------|            |&lt;BR /&gt;
|                             |   No_Pmt   |  Part_Pmt  |  Full_Pmt  |  Over_Pmt  |    All    |&lt;BR /&gt;
|                             |-----------------+----------------+----------------+-----------------+------------|&lt;BR /&gt;
|                             |     N           |     N         |     N          |     N           |     N      |&lt;BR /&gt;
|-----------------------------+----------------+---------------+----------------+-----------------+-------------|&lt;BR /&gt;
|Agent                    |                   |                |                 |                  |              |&lt;BR /&gt;
|-----------------------------|                  |                |                  |                  |              |&lt;BR /&gt;
|1401                      |            1.00|               .|                 .|                 .|        1.00|&lt;BR /&gt;
|-----------------------------+----------------+---------------+----------------+-----------------+-------------|&lt;BR /&gt;
|1423                      |            2.00|               .|                .|                 .|        2.00|&lt;BR /&gt;
----------------------------------------------------------------------------------------------------------------------</description>
    <pubDate>Mon, 10 Jan 2011 14:02:58 GMT</pubDate>
    <dc:creator>Jackie_Stanbank</dc:creator>
    <dc:date>2011-01-10T14:02:58Z</dc:date>
    <item>
      <title>percentages in tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/percentages-in-tabulate/m-p/60735#M17217</link>
      <description>i have a tabulate with below output. i want the numbers to be represented as a percentage of "All". is there an easier way to do this apart from a proc summary and merge?&lt;BR /&gt;
                              |         Broken                 |          Kept                   |            |&lt;BR /&gt;
|                             |------------------------------------+-----------------------------------|            |&lt;BR /&gt;
|                             |   No_Pmt   |  Part_Pmt  |  Full_Pmt  |  Over_Pmt  |    All    |&lt;BR /&gt;
|                             |-----------------+----------------+----------------+-----------------+------------|&lt;BR /&gt;
|                             |     N           |     N         |     N          |     N           |     N      |&lt;BR /&gt;
|-----------------------------+----------------+---------------+----------------+-----------------+-------------|&lt;BR /&gt;
|Agent                    |                   |                |                 |                  |              |&lt;BR /&gt;
|-----------------------------|                  |                |                  |                  |              |&lt;BR /&gt;
|1401                      |            1.00|               .|                 .|                 .|        1.00|&lt;BR /&gt;
|-----------------------------+----------------+---------------+----------------+-----------------+-------------|&lt;BR /&gt;
|1423                      |            2.00|               .|                .|                 .|        2.00|&lt;BR /&gt;
----------------------------------------------------------------------------------------------------------------------</description>
      <pubDate>Mon, 10 Jan 2011 14:02:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/percentages-in-tabulate/m-p/60735#M17217</guid>
      <dc:creator>Jackie_Stanbank</dc:creator>
      <dc:date>2011-01-10T14:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: percentages in tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/percentages-in-tabulate/m-p/60736#M17218</link>
      <description>probably.&lt;BR /&gt;
what code do you have so far?&lt;BR /&gt;
it only needs a small variation, I expect</description>
      <pubDate>Mon, 10 Jan 2011 15:25:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/percentages-in-tabulate/m-p/60736#M17218</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-01-10T15:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: percentages in tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/percentages-in-tabulate/m-p/60737#M17219</link>
      <description>Hi:&lt;BR /&gt;
  PROC TABULATE has more percent statistics than any other procedure, starting with PCTN (percent of the overall count (or N), ROWPCTN, COLPCTN, PAGEPCTN and REPPCTN. If you want the percent of a numeric variable (not just the count), then the "SUM" version of the percent statistics: PCTSUM, ROWPCTSUM, COLPCTSUM, PAGEPCTSUM and REPPCTSUM get called into action.&lt;BR /&gt;
 &lt;BR /&gt;
  As Peter said -- it is probably a simple change to the code you already have.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 10 Jan 2011 15:41:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/percentages-in-tabulate/m-p/60737#M17219</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-01-10T15:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: percentages in tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/percentages-in-tabulate/m-p/60738#M17220</link>
      <description>ok here is a small attempt to demo.&lt;BR /&gt;
Not knowing what is really wanted, and how the underlying data are structured, it probably does not hit the mark, but might give an idea&lt;BR /&gt;
data peterC ;&lt;BR /&gt;
input agent $ type $ amount ;&lt;BR /&gt;
list;cards;&lt;BR /&gt;
1401 npmt  .&lt;BR /&gt;
1401 part  123&lt;BR /&gt;
1401 over  256&lt;BR /&gt;
1423 npmt .&lt;BR /&gt;
1423 npmt .&lt;BR /&gt;
1423 full 999 &lt;BR /&gt;
1423 part 100&lt;BR /&gt;
1423 part 115&lt;BR /&gt;
;&lt;BR /&gt;
proc tabulate missing formchar='|----|+|---';&lt;BR /&gt;
class agent type ;&lt;BR /&gt;
var amount ;&lt;BR /&gt;
title 'payment type distribution' ;&lt;BR /&gt;
table agent all, type=' '*pctN&lt;TYPE&gt;='%' *f= 6.1 all*N*f= 5./rts=11 box='              per-cent by number';&lt;BR /&gt;
table agent all, type=' '*amount=' ' *pctsum&lt;TYPE&gt;='%' *f= 6.1 all*amount*sum=' '*f= 8./rts=11 box='           per-cent by value';&lt;BR /&gt;
run;[pre]payment type distribution     16:20 Monday, January 10, 2011   1&lt;BR /&gt;
&lt;BR /&gt;
---------------------------------------------&lt;BR /&gt;
|         | full | npmt | over | part | All |&lt;BR /&gt;
|per-cent |------+------+------+------+-----|&lt;BR /&gt;
|by number|  %   |  %   |  %   |  %   |  N  |&lt;BR /&gt;
|---------+------+------+------+------+-----|&lt;BR /&gt;
|agent    |      |      |      |      |     |&lt;BR /&gt;
|---------|      |      |      |      |     |&lt;BR /&gt;
|1401     |     .|  33.3|  33.3|  33.3|    3|&lt;BR /&gt;
|---------+------+------+------+------+-----|&lt;BR /&gt;
|1423     |  20.0|  40.0|     .|  40.0|    5|&lt;BR /&gt;
|---------+------+------+------+------+-----|&lt;BR /&gt;
|All      |  12.5|  37.5|  12.5|  37.5|    8|&lt;BR /&gt;
---------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
payment type distribution     16:20 Monday, January 10, 2011   2&lt;BR /&gt;
&lt;BR /&gt;
------------------------------------------------&lt;BR /&gt;
|         | full | npmt | over | part |  All   |&lt;BR /&gt;
|per-cent |------+------+------+------+--------|&lt;BR /&gt;
|by value |  %   |  %   |  %   |  %   | amount |&lt;BR /&gt;
|---------+------+------+------+------+--------|&lt;BR /&gt;
|agent    |      |      |      |      |        |&lt;BR /&gt;
|---------|      |      |      |      |        |&lt;BR /&gt;
|1401     |     .|     .|  67.5|  32.5|     379|&lt;BR /&gt;
|---------+------+------+------+------+--------|&lt;BR /&gt;
|1423     |  82.3|     .|     .|  17.7|    1214|&lt;BR /&gt;
|---------+------+------+------+------+--------|&lt;BR /&gt;
|All      |  62.7|     .|  16.1|  21.2|    1593|&lt;BR /&gt;
------------------------------------------------&lt;BR /&gt;
[/pre] and recommend the [ pre ] signals to present results in a fixed pitch for ordinary listing of tables or columns. The best place to find this is at  &lt;A href="http://support.sas.com/forums/thread.jspa?messageID=27609毙" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=27609毙&lt;/A&gt; &lt;BR /&gt;
 &lt;BR /&gt;
peterC&lt;/TYPE&gt;&lt;/TYPE&gt;</description>
      <pubDate>Mon, 10 Jan 2011 16:25:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/percentages-in-tabulate/m-p/60738#M17220</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-01-10T16:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: percentages in tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/percentages-in-tabulate/m-p/60739#M17221</link>
      <description>thanx for the feedback.  i will try and apply the suggested code.&lt;BR /&gt;
FYI my code is as follows (with count only):&lt;BR /&gt;
&lt;BR /&gt;
proc tabulate data= vaf_ptps_pmts3 out= vaf_ptps_pmts4;&lt;BR /&gt;
class adj result pmt_status;&lt;BR /&gt;
var ptp_cnt;&lt;BR /&gt;
&lt;BR /&gt;
table adj ={label='Agent' s=[background=very dark blue foreground=white]},&lt;BR /&gt;
	  result ={label=' ' s=[background=very dark blue foreground=white]}*&lt;BR /&gt;
	  pmt_status ={label=' ' s=[background=very dark blue foreground=white]} &lt;BR /&gt;
	  all;&lt;BR /&gt;
where month = 'Dec-10';&lt;BR /&gt;
run;</description>
      <pubDate>Tue, 11 Jan 2011 05:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/percentages-in-tabulate/m-p/60739#M17221</guid>
      <dc:creator>Jackie_Stanbank</dc:creator>
      <dc:date>2011-01-11T05:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: percentages in tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/percentages-in-tabulate/m-p/60740#M17222</link>
      <description>so that suggests a table statement like&lt;BR /&gt;
table adj ={label='Agent' s=[background=very dark blue foreground=white]},&lt;BR /&gt;
 result ={label=' ' s=[background=very dark blue foreground=white]}*&lt;BR /&gt;
 pmt_status ={label=' ' s=[background=very dark blue foreground=white]} * pctn&lt;RESULT&gt;='%'&lt;BR /&gt;
 	  all *N ;&lt;BR /&gt;
&lt;BR /&gt;
or RowPctN instead of result*pmt_status as denominator definition (since SAS91 has made that so much simpler when the table structure permits)

since I cannot test on your data structure, I decided to offer the simpler alternative denominator definition ROWpctN         &lt;BR /&gt;
Message was edited by: Peter.C&lt;/RESULT&gt;</description>
      <pubDate>Tue, 11 Jan 2011 12:04:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/percentages-in-tabulate/m-p/60740#M17222</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-01-11T12:04:15Z</dc:date>
    </item>
  </channel>
</rss>

