<?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 calculate percentages by subgroups in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-calculate-percentages-by-subgroups/m-p/870193#M38507</link>
    <description>&lt;P&gt;Please show your existing Proc Tabulate code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do not want the missing values for your dosage_3m variable included in the denominators for Pctn calculations then you need to exclude them, such as not include MISSING on the class statement for that variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to include the missing then you will have to modify the data and pick another approach to get something like this in proc tabulate. One approach would be to add another variable has a value of 1 only when Dosage_3m is not missing and then use that variable as a Var variable and ColPctSum with that variable instead of ColPctN of the Class variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Apr 2023 15:27:42 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-04-17T15:27:42Z</dc:date>
    <item>
      <title>Proc tabulate calculate percentages by subgroups</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-calculate-percentages-by-subgroups/m-p/870129#M38501</link>
      <description>&lt;P&gt;I have the following table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2023-04-17 at 12.06.51.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82757i40BE5B177CCD7629/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2023-04-17 at 12.06.51.png" alt="Screen Shot 2023-04-17 at 12.06.51.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Suppose to look at Drug3 dosage 0.75 and 1.5. Is there a way with proc tabulate or another proc to compute the percentage on 21520 + 34732? In other words, the percentage for 0.75 should be 21520/(21520 + 34732)=38% and for 1.5 should be 34732/(21520 + 34732)=61%&lt;/P&gt;
&lt;P&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 11:00:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-calculate-percentages-by-subgroups/m-p/870129#M38501</guid>
      <dc:creator>NewUsrStat</dc:creator>
      <dc:date>2023-04-17T11:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate calculate percentages by subgroups</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-calculate-percentages-by-subgroups/m-p/870144#M38502</link>
      <description>I think PROC SQL can do that.&lt;BR /&gt;Can you post your data and the output you want?</description>
      <pubDate>Mon, 17 Apr 2023 11:59:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-calculate-percentages-by-subgroups/m-p/870144#M38502</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-04-17T11:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate calculate percentages by subgroups</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-calculate-percentages-by-subgroups/m-p/870193#M38507</link>
      <description>&lt;P&gt;Please show your existing Proc Tabulate code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do not want the missing values for your dosage_3m variable included in the denominators for Pctn calculations then you need to exclude them, such as not include MISSING on the class statement for that variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to include the missing then you will have to modify the data and pick another approach to get something like this in proc tabulate. One approach would be to add another variable has a value of 1 only when Dosage_3m is not missing and then use that variable as a Var variable and ColPctSum with that variable instead of ColPctN of the Class variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 15:27:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-calculate-percentages-by-subgroups/m-p/870193#M38507</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-04-17T15:27:42Z</dc:date>
    </item>
  </channel>
</rss>

