<?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: Proc tabulate in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate/m-p/489671#M127915</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Thank you so much! I will test it on Monday when I will have access to SAS!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Aug 2018 16:15:28 GMT</pubDate>
    <dc:creator>Nitte</dc:creator>
    <dc:date>2018-08-24T16:15:28Z</dc:date>
    <item>
      <title>Proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate/m-p/489620#M127888</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create a table from the following data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Income $ &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ID Income $ Pension;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;cards&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 400-500 .&lt;/P&gt;&lt;P&gt;2 300-400 1&lt;/P&gt;&lt;P&gt;3 500- 1&lt;/P&gt;&lt;P&gt;4 200-300 .&lt;/P&gt;&lt;P&gt;5 300-400 .&lt;/P&gt;&lt;P&gt;6 400-500 1&lt;/P&gt;&lt;P&gt;7 300-400 1&lt;/P&gt;&lt;P&gt;8 200-300 .&lt;/P&gt;&lt;P&gt;9 100-200 .&lt;/P&gt;&lt;P&gt;10 500- 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data i this example concist of 10 individuals belonging to different income groups where som of them have pension payments (Pension=1) and some does not (Pension=.).&lt;/P&gt;&lt;P&gt;I have to create a table with proc tabulate that shows (1)&amp;nbsp;the number of people in each income group, (2)&amp;nbsp;the number of people with pension payments in each income group and (3) the percentege of people with pension payments of the total population in each income group.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following syntax output the answer for the first two questions. I need help with the one regarding the percentege of people with pension payments of the total population in each income group.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;tabulate&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Have &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;comma12.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;class&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Income ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ID Pension ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Income=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;''&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; All=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Total'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;ID=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Total population'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;*N=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;''&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Pension=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'People with pensions'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; *sum=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;''&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;FONT face="Courier New" size="2"&gt;/&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;box&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Income group'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 14:49:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate/m-p/489620#M127888</guid>
      <dc:creator>Nitte</dc:creator>
      <dc:date>2018-08-24T14:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate/m-p/489639#M127897</link>
      <description>&lt;P&gt;Perhaps this will get you started:&lt;/P&gt;
&lt;PRE&gt;   data have;
length Income $ 10;
input ID Income $ Pension;
cards;
1 400-500 0
2 300-400 1
3 500- 1
4 200-300 0
5 300-400 0
6 400-500 1
7 300-400 1
8 200-300 0
9 100-200 0
10 500- 1
;
run;
proc tabulate data=Have format=comma12. ;
class Income ;
var ID Pension ;
table Income='' All='Total',
ID='Total population'*N=''
Pension='People with pensions' * (sum='Count' mean="%"*f=percent8.)
 
 /box='Income group';
run;
&lt;/PRE&gt;
&lt;P&gt;Mean of 0/1 coded variable is the percent of "1" values. Either use a percentw. format as shown or if you dislike the % signs then a custom format with the MULT option can show a "nice" percentage value such as 66.7 instead of .666666.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 15:23:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate/m-p/489639#M127897</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-24T15:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate/m-p/489656#M127906</link>
      <description>&lt;P&gt;Hope this should solve your problem:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
	picture pct (round) low-high='009.99%';
run;

proc tabulate data=Have format=comma12.;
	class Income;
	var ID Pension;

	table Income='' All='Total',
		ID='Total population'*N='' 
		pension='People with pensions' *sum='' 
		pension*ROWPCTN&amp;lt;ID&amp;gt;*f=pct. 
		/box='Income group';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Aug 2018 15:54:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate/m-p/489656#M127906</guid>
      <dc:creator>AlokR</dc:creator>
      <dc:date>2018-08-24T15:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate/m-p/489670#M127914</link>
      <description>&lt;P&gt;Thank you so much! I will test it on Monday when I will have access to SAS!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 16:15:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate/m-p/489670#M127914</guid>
      <dc:creator>Nitte</dc:creator>
      <dc:date>2018-08-24T16:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate/m-p/489671#M127915</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you so much! I will test it on Monday when I will have access to SAS!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 16:15:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate/m-p/489671#M127915</guid>
      <dc:creator>Nitte</dc:creator>
      <dc:date>2018-08-24T16:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate/m-p/490012#M128088</link>
      <description>&lt;P&gt;Thanks again! your soution worked well!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 09:22:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate/m-p/490012#M128088</guid>
      <dc:creator>Nitte</dc:creator>
      <dc:date>2018-08-27T09:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate/m-p/490149#M128156</link>
      <description>Glad it worked.&lt;BR /&gt;Can you please mark this as solution so that I can be removed from unanswered list?</description>
      <pubDate>Mon, 27 Aug 2018 16:12:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate/m-p/490149#M128156</guid>
      <dc:creator>AlokR</dc:creator>
      <dc:date>2018-08-27T16:12:49Z</dc:date>
    </item>
  </channel>
</rss>

