<?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: Calculating percents in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-percents/m-p/19464#M3967</link>
    <description>Thanks you all for suggestions.&lt;BR /&gt;
&lt;BR /&gt;
Masoud</description>
    <pubDate>Wed, 20 Oct 2010 14:42:35 GMT</pubDate>
    <dc:creator>mpajoh</dc:creator>
    <dc:date>2010-10-20T14:42:35Z</dc:date>
    <item>
      <title>Calculating percents</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-percents/m-p/19461#M3964</link>
      <description>Is there procedure that calculates percentages and creates an output data set, like "proc tabulate" does for reports.&lt;BR /&gt;
&lt;BR /&gt;
Thanks;&lt;BR /&gt;
Masoud</description>
      <pubDate>Tue, 19 Oct 2010 20:34:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculating-percents/m-p/19461#M3964</guid>
      <dc:creator>mpajoh</dc:creator>
      <dc:date>2010-10-19T20:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating percents</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-percents/m-p/19462#M3965</link>
      <description>Look at PROC MEANS, and possibly using a BY statement with your variable list.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
proc calculate percentage site:sas.com

Message was edited by: sbb</description>
      <pubDate>Tue, 19 Oct 2010 20:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculating-percents/m-p/19462#M3965</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-10-19T20:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating percents</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-percents/m-p/19463#M3966</link>
      <description>Hi:&lt;BR /&gt;
  Although PROC FREQ will create an output dataset with percentages, is there a reason you don't want to use PROC TABULATE to calculate percentages??? For example, the program below:&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc freq data=sashelp.class;&lt;BR /&gt;
  tables age/out=work.frqage;&lt;BR /&gt;
run;&lt;BR /&gt;
          &lt;BR /&gt;
ods listing;&lt;BR /&gt;
proc print data=work.frqage;&lt;BR /&gt;
  title 'Data set created by PROC FREQ';&lt;BR /&gt;
run;&lt;BR /&gt;
             &lt;BR /&gt;
proc tabulate data=sashelp.class &lt;BR /&gt;
              out=work.tabage(rename=(N=Count PCTN_0=Percent));&lt;BR /&gt;
  class age;&lt;BR /&gt;
  table age,&lt;BR /&gt;
        n pctn;&lt;BR /&gt;
run;&lt;BR /&gt;
             &lt;BR /&gt;
proc print data=work.tabage;&lt;BR /&gt;
  title 'Data set created by PROC TABULATE';&lt;BR /&gt;
  title2 'You can drop or ignore _TYPE_, _TABLE_ and _PAGE_';&lt;BR /&gt;
run;&lt;BR /&gt;
      &lt;BR /&gt;
title;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
  &lt;BR /&gt;
generates the same results as shown at the bottom of this post.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
PROC FREQ output dataset:&lt;BR /&gt;
Data set created by PROC FREQ&lt;BR /&gt;
                      &lt;BR /&gt;
Obs    Age    COUNT    PERCENT&lt;BR /&gt;
 1      11      2      10.5263&lt;BR /&gt;
 2      12      5      26.3158&lt;BR /&gt;
 3      13      3      15.7895&lt;BR /&gt;
 4      14      4      21.0526&lt;BR /&gt;
 5      15      4      21.0526&lt;BR /&gt;
 6      16      1       5.2632&lt;BR /&gt;
                            &lt;BR /&gt;
------------------------------------------------------------&lt;BR /&gt;
                             &lt;BR /&gt;
PROC TABULATE output dataset:&lt;BR /&gt;
Data set created by PROC TABULATE&lt;BR /&gt;
You can drop or ignore _TYPE_, _TABLE_ and _PAGE_&lt;BR /&gt;
                                     &lt;BR /&gt;
Obs    Age    _TYPE_    _PAGE_    _TABLE_    Count    Percent&lt;BR /&gt;
 1      11      1          1         1         2      10.5263&lt;BR /&gt;
 2      12      1          1         1         5      26.3158&lt;BR /&gt;
 3      13      1          1         1         3      15.7895&lt;BR /&gt;
 4      14      1          1         1         4      21.0526&lt;BR /&gt;
 5      15      1          1         1         4      21.0526&lt;BR /&gt;
 6      16      1          1         1         1       5.2632&lt;BR /&gt;
&lt;BR /&gt;
[/pre]</description>
      <pubDate>Tue, 19 Oct 2010 20:49:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculating-percents/m-p/19463#M3966</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-10-19T20:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating percents</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-percents/m-p/19464#M3967</link>
      <description>Thanks you all for suggestions.&lt;BR /&gt;
&lt;BR /&gt;
Masoud</description>
      <pubDate>Wed, 20 Oct 2010 14:42:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculating-percents/m-p/19464#M3967</guid>
      <dc:creator>mpajoh</dc:creator>
      <dc:date>2010-10-20T14:42:35Z</dc:date>
    </item>
  </channel>
</rss>

