<?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 PCTN Denominator Troubles in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-PCTN-Denominator-Troubles/m-p/555142#M267870</link>
    <description>Thanks.Your 4th table is exactly what i need and i had trouble before.</description>
    <pubDate>Tue, 30 Apr 2019 17:35:55 GMT</pubDate>
    <dc:creator>XiaoGuaiShou</dc:creator>
    <dc:date>2019-04-30T17:35:55Z</dc:date>
    <item>
      <title>Proc Tabulate PCTN Denominator Troubles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-PCTN-Denominator-Troubles/m-p/226144#M267867</link>
      <description>&lt;P&gt;Hey folks, first time posting here. I'm running into trouble when trying to get a Percent N (PCTN) from a proc tabulate. We're trying to see how male/female college course enrollments and withdrawals differ, across several years.&amp;nbsp;The following image shows 3 CSCI course, with female and male enrollment counts in the first column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/185iDD4A018BFFB8F20C/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="pctn.png" title="pctn.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want PCTN to reflect the INTRA-course, INTRA-year enrollment totals (i.e. the denominator should be the enrollment total for that course, in that year). So, for year 2013 and CSCI course 181, the F enrollment count of 68 should give a PCTN of 51.1%. Can someone help me modify my code to produce this result? Here's my code ('ay' is academic year, btw):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc tabulate data= csci_grades missing;
&amp;nbsp; &amp;nbsp; &amp;nbsp;where ay in ('2013','2014') and sex in ('M','F');
&amp;nbsp; &amp;nbsp; &amp;nbsp;class course sex ay;
&amp;nbsp; &amp;nbsp; &amp;nbsp;var enroll withdraw_flag;
&amp;nbsp; &amp;nbsp; &amp;nbsp;table course=' '*(sex=' ' all='Course Total'), ay*(enroll*n enroll*pctn withdraw_flag*n withdraw_flag*pctn all='Inner All') all='Outer All';
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much for your help!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2015 21:21:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-PCTN-Denominator-Troubles/m-p/226144#M267867</guid>
      <dc:creator>techsassy</dc:creator>
      <dc:date>2015-09-17T21:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate PCTN Denominator Troubles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-PCTN-Denominator-Troubles/m-p/226148#M267868</link>
      <description>&lt;P&gt;If you provide some example data in the form of data step code we can test things a tad better.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like you want a form of COLPCTN&amp;lt;enroll&amp;gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2015 22:03:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-PCTN-Denominator-Troubles/m-p/226148#M267868</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-09-17T22:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate PCTN Denominator Troubles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-PCTN-Denominator-Troubles/m-p/226472#M267869</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Here is a sample program that illustrates the use of PCTN, ROWPCTN and COLPCTN and then shows calculating a percent of a group based on using a custom denominator. The program makes some fake data that sort of mimics what you are doing with nested groups in the row dimension and a date-based variable in the column dimension. You can see the same values for the rows and columns in every table, but the percent numbers change on the denominator being used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example of TABLE 1 (percent of Grand Total) versus TABLE 4 (custom denominator) since the program is so long, I am not going to post all 4 tables, but you should be able to run the program yourself to see the other tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TABLE 1&lt;/P&gt;&lt;P&gt;&lt;IMG title="table1.png" alt="table1.png" src="https://communities.sas.com/t5/image/serverpage/image-id/241iA5A49C315D7E31F4/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;&lt;P&gt;TABLE 4&lt;/P&gt;&lt;P&gt;&lt;IMG title="table4.png" alt="table4.png" src="https://communities.sas.com/t5/image/serverpage/image-id/242i09F0037BA13CBAF9/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;proc tabulate data=newprice;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; class regionname productname date;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var sale ;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table regionname=' '*(productname=' ' all='Course Total') all, &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date*(sale*(n pctn)) all='Outer All'*(n pctn) / &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; box='1 divided by grand total';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table regionname=' '*(productname=' ' all='Course Total') all, &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date*(sale*(n rowpctn)) all='Outer All'*(n rowpctn) / &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; box='2 divided by row total';&amp;nbsp; &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table regionname=' '*(productname=' ' all='Course Total') all, &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date*(sale*(n colpctn)) all='Outer All'*(n colpctn) / &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; box='3 divided by column total';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table regionname=' '*(productname=' ' all='Course Total'), &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date*(sale*(n pctn&amp;lt;productname all&amp;gt;)) all='Outer All'*(n pctn&amp;lt;productname all&amp;gt;) / &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; box='4 using custom denom to get productname total';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format date monname3.;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Sep 2015 20:30:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-PCTN-Denominator-Troubles/m-p/226472#M267869</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-09-20T20:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate PCTN Denominator Troubles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-PCTN-Denominator-Troubles/m-p/555142#M267870</link>
      <description>Thanks.Your 4th table is exactly what i need and i had trouble before.</description>
      <pubDate>Tue, 30 Apr 2019 17:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-PCTN-Denominator-Troubles/m-p/555142#M267870</guid>
      <dc:creator>XiaoGuaiShou</dc:creator>
      <dc:date>2019-04-30T17:35:55Z</dc:date>
    </item>
  </channel>
</rss>

