<?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 means calculate percent from total in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-calculate-percent-from-total/m-p/487353#M126983</link>
    <description>&lt;P&gt;You would need to do it in a couple steps, eg:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=yourdata;
  by group;
  var your-var;
  output out=group sum=total;

proc means data=yourdata;
  by group subgroup;
  var your-var;
  output out=subgroup sum=subtotal;

data pct_of_total;
  merge group subgroup;
  by group;
  pct_of_total=subtotal/total;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 16 Aug 2018 11:45:31 GMT</pubDate>
    <dc:creator>cau83</dc:creator>
    <dc:date>2018-08-16T11:45:31Z</dc:date>
    <item>
      <title>Proc means calculate percent from total</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-calculate-percent-from-total/m-p/487310#M126962</link>
      <description>&lt;P&gt;Hello everyone&lt;/P&gt;&lt;P&gt;Is it possible to&amp;nbsp;&amp;nbsp;calculate percent from total in proc means &amp;gt;?&lt;/P&gt;&lt;P&gt;Thanks&lt;A href="http://orion.journals.ac.za/pub/user/viewPublicProfile/27950" target="_self"&gt;.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 08:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-calculate-percent-from-total/m-p/487310#M126962</guid>
      <dc:creator>kullboys</dc:creator>
      <dc:date>2018-08-16T08:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means calculate percent from total</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-calculate-percent-from-total/m-p/487353#M126983</link>
      <description>&lt;P&gt;You would need to do it in a couple steps, eg:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=yourdata;
  by group;
  var your-var;
  output out=group sum=total;

proc means data=yourdata;
  by group subgroup;
  var your-var;
  output out=subgroup sum=subtotal;

data pct_of_total;
  merge group subgroup;
  by group;
  pct_of_total=subtotal/total;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Aug 2018 11:45:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-calculate-percent-from-total/m-p/487353#M126983</guid>
      <dc:creator>cau83</dc:creator>
      <dc:date>2018-08-16T11:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means calculate percent from total</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-calculate-percent-from-total/m-p/487445#M127021</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226592"&gt;@kullboys&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello everyone&lt;/P&gt;
&lt;P&gt;Is it possible to&amp;nbsp;&amp;nbsp;calculate percent from total in proc means &amp;gt;?&lt;/P&gt;
&lt;P&gt;Thanks&lt;A href="http://orion.journals.ac.za/pub/user/viewPublicProfile/27950" target="_self"&gt;.&lt;/A&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Other than not very clearly explaining what "from total" might imply (I can think of several interpretations), not in proc means. The documentation is pretty clear about what statistics proc means will calculate and percentages are not included.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc means can create an output data set that likely has the sums and/or n's that you need but will take other steps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc tabulate and report both will create percentages but of specific forms and without actual example data and the desired result I can't go any further than that.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 14:37:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-calculate-percent-from-total/m-p/487445#M127021</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-16T14:37:02Z</dc:date>
    </item>
  </channel>
</rss>

