<?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/66232#M18899</link>
    <description>Hi All,&lt;BR /&gt;
&lt;BR /&gt;
I have three ciolumns in a SAS dataset 'All' :- Source, Converting users, Non Converting users.&lt;BR /&gt;
&lt;BR /&gt;
In  the Source, I have codes - 'A','B','C','D'&lt;BR /&gt;
&lt;BR /&gt;
Could you suggest how I can find the Percentage of Converting users which is defined as: (Converting users / Total users)for each source.&lt;BR /&gt;
&lt;BR /&gt;
Kind Regards&lt;BR /&gt;
Kriti</description>
    <pubDate>Thu, 27 Jan 2011 14:09:05 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2011-01-27T14:09:05Z</dc:date>
    <item>
      <title>PROC TABULATE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE/m-p/66232#M18899</link>
      <description>Hi All,&lt;BR /&gt;
&lt;BR /&gt;
I have three ciolumns in a SAS dataset 'All' :- Source, Converting users, Non Converting users.&lt;BR /&gt;
&lt;BR /&gt;
In  the Source, I have codes - 'A','B','C','D'&lt;BR /&gt;
&lt;BR /&gt;
Could you suggest how I can find the Percentage of Converting users which is defined as: (Converting users / Total users)for each source.&lt;BR /&gt;
&lt;BR /&gt;
Kind Regards&lt;BR /&gt;
Kriti</description>
      <pubDate>Thu, 27 Jan 2011 14:09:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE/m-p/66232#M18899</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-27T14:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TABULATE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE/m-p/66233#M18900</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
my solution is based on proc report which has the advantage of fields calculation:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc report data=sashelp.class nowd box;&lt;BR /&gt;
&lt;BR /&gt;
column sex height weight total height_proc total_last ;&lt;BR /&gt;
&lt;BR /&gt;
define sex / group width=12;&lt;BR /&gt;
define height / analysis noprint;&lt;BR /&gt;
define weight / analysis noprint;&lt;BR /&gt;
&lt;BR /&gt;
define height_proc / computed format=percent7.1 width=12;&lt;BR /&gt;
&lt;BR /&gt;
define total / computed noprint ;&lt;BR /&gt;
define total_last / computed format=comma8. width=12;&lt;BR /&gt;
&lt;BR /&gt;
compute total;&lt;BR /&gt;
	total=height.sum+weight.sum;&lt;BR /&gt;
endcomp;&lt;BR /&gt;
&lt;BR /&gt;
compute height_proc;&lt;BR /&gt;
	height_proc=height.sum/total;&lt;BR /&gt;
endcomp;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
compute total_last;&lt;BR /&gt;
	total_last=total;&lt;BR /&gt;
endcomp;&lt;BR /&gt;
&lt;BR /&gt;
compute after;&lt;BR /&gt;
&lt;BR /&gt;
	line "Total number of Users:" +5 total_last comma8.;&lt;BR /&gt;
&lt;BR /&gt;
endcomp;&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Marius</description>
      <pubDate>Thu, 27 Jan 2011 14:54:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE/m-p/66233#M18900</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-27T14:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TABULATE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE/m-p/66234#M18901</link>
      <description>Hi Marius,&lt;BR /&gt;
&lt;BR /&gt;
Many thanks for the suggestion. I tried this code on the data that I have but when I try to find the Percentages there are blanks.&lt;BR /&gt;
&lt;BR /&gt;
Suppose I have the SAS data set 'All':&lt;BR /&gt;
&lt;BR /&gt;
Source       Converted Users  Non Converted Users  Total&lt;BR /&gt;
A                   100                    567                         667&lt;BR /&gt;
A                   200                    328                         528&lt;BR /&gt;
A                   150                    938                         1088&lt;BR /&gt;
B                   140                    843                         983&lt;BR /&gt;
B                   143                    327                         470&lt;BR /&gt;
C                   327                    732                         1059&lt;BR /&gt;
D                   323                    634                         957&lt;BR /&gt;
C                   133                    526&lt;BR /&gt;
D                   268                    828&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I use the code:-&lt;BR /&gt;
&lt;BR /&gt;
proc report data=all nowd box;&lt;BR /&gt;
column Source Percent;&lt;BR /&gt;
define Source / group width=12;&lt;BR /&gt;
compute Percent;&lt;BR /&gt;
	Percent=(Converting_users/Total)*100;&lt;BR /&gt;
endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
The code works well but does not ouput the desired Percent for each Source.&lt;BR /&gt;
&lt;BR /&gt;
Kind Regards&lt;BR /&gt;
Kriti</description>
      <pubDate>Thu, 27 Jan 2011 15:52:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE/m-p/66234#M18901</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-27T15:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TABULATE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE/m-p/66235#M18902</link>
      <description>hello,&lt;BR /&gt;
&lt;BR /&gt;
your proc report has no information about Converting_users and Total, this is the reason why you have blanks for percentages. you should add those data set variables in the column statement (&lt;B&gt;to the left of percent&lt;/B&gt;) ,define them as analysis variables. I suppose your total variable is calculated for all observations and has no missing, as appears on the last 2 lines of your post, otherwise I suggest to calculate it in the report as shown in my previous post:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc report  nowd box;&lt;BR /&gt;
column Source Converting_users Total Percent;&lt;BR /&gt;
define Source / group width=12;&lt;BR /&gt;
&lt;BR /&gt;
define Converting_users / analysis  noprint width=12;&lt;BR /&gt;
define Total / analysis noprint  width=12;&lt;BR /&gt;
&lt;BR /&gt;
define percent / computed;&lt;BR /&gt;
&lt;BR /&gt;
compute Percent;&lt;BR /&gt;
percent=(Converting_users.sum/Total.sum)*100;&lt;BR /&gt;
endcomp;&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Marius</description>
      <pubDate>Thu, 27 Jan 2011 16:24:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE/m-p/66235#M18902</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-27T16:24:30Z</dc:date>
    </item>
  </channel>
</rss>

