<?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 pctsum by group? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-pctsum-by-group/m-p/49514#M13451</link>
    <description>Hi guys,&lt;BR /&gt;
&lt;BR /&gt;
So sorry as this is probably really simple but I've searched and read papers and still cant quite get this.  Basically, I've got several groups and subgroups each with an ep_amt and a loss_amt.  What I want to do is divide loss_amt by ep_amt for each group.  I know its pctsum that I need but I can't get it just right.  Here's my code:&lt;BR /&gt;
&lt;BR /&gt;
data test_data;&lt;BR /&gt;
	input layer $10.&lt;BR /&gt;
		  asset_range $10.&lt;BR /&gt;
		  reinsurer_group $10.&lt;BR /&gt;
		  ep_amt 10.2&lt;BR /&gt;
		  loss_amt 10.2&lt;BR /&gt;
		  ;&lt;BR /&gt;
cards;	&lt;BR /&gt;
layer1    range1    reins1    1000.21   100.50&lt;BR /&gt;
layer1	  range1	reins2	   300.00   200.75&lt;BR /&gt;
layer1	  range2	reins1	  3000.00   201.25&lt;BR /&gt;
layer2	  range1	reins1	  3001.32   222.23&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
proc tabulate data=test_data f=10.2;&lt;BR /&gt;
	var ep_amt loss_amt;&lt;BR /&gt;
	class  layer asset_range reinsurer_group;&lt;BR /&gt;
	table layer * asset_range, &lt;BR /&gt;
		  reinsurer_group * (ep_amt loss_amt) * sum;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
That gets me almost there.  What I now need is to insert a column under each re-insurer that is the loss_amt / ep_amt.  Any help would be appreciated!&lt;BR /&gt;
&lt;BR /&gt;
Thanks!!</description>
    <pubDate>Wed, 13 Apr 2011 15:37:07 GMT</pubDate>
    <dc:creator>FrankE</dc:creator>
    <dc:date>2011-04-13T15:37:07Z</dc:date>
    <item>
      <title>proc tabulate pctsum by group?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-pctsum-by-group/m-p/49514#M13451</link>
      <description>Hi guys,&lt;BR /&gt;
&lt;BR /&gt;
So sorry as this is probably really simple but I've searched and read papers and still cant quite get this.  Basically, I've got several groups and subgroups each with an ep_amt and a loss_amt.  What I want to do is divide loss_amt by ep_amt for each group.  I know its pctsum that I need but I can't get it just right.  Here's my code:&lt;BR /&gt;
&lt;BR /&gt;
data test_data;&lt;BR /&gt;
	input layer $10.&lt;BR /&gt;
		  asset_range $10.&lt;BR /&gt;
		  reinsurer_group $10.&lt;BR /&gt;
		  ep_amt 10.2&lt;BR /&gt;
		  loss_amt 10.2&lt;BR /&gt;
		  ;&lt;BR /&gt;
cards;	&lt;BR /&gt;
layer1    range1    reins1    1000.21   100.50&lt;BR /&gt;
layer1	  range1	reins2	   300.00   200.75&lt;BR /&gt;
layer1	  range2	reins1	  3000.00   201.25&lt;BR /&gt;
layer2	  range1	reins1	  3001.32   222.23&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
proc tabulate data=test_data f=10.2;&lt;BR /&gt;
	var ep_amt loss_amt;&lt;BR /&gt;
	class  layer asset_range reinsurer_group;&lt;BR /&gt;
	table layer * asset_range, &lt;BR /&gt;
		  reinsurer_group * (ep_amt loss_amt) * sum;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
That gets me almost there.  What I now need is to insert a column under each re-insurer that is the loss_amt / ep_amt.  Any help would be appreciated!&lt;BR /&gt;
&lt;BR /&gt;
Thanks!!</description>
      <pubDate>Wed, 13 Apr 2011 15:37:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-pctsum-by-group/m-p/49514#M13451</guid>
      <dc:creator>FrankE</dc:creator>
      <dc:date>2011-04-13T15:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate pctsum by group?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-pctsum-by-group/m-p/49515#M13452</link>
      <description>Hi:&lt;BR /&gt;
  TABULATE supports the use of custom denominator definitions through the use of the &amp;lt; and &amp;gt; operators, as shown in the code below. Since SUM will be the default statistic for EP_AMT and LOSS_AMT, you do not need SUM in the TABLE statement for those 2 variables and it simplifies the TABLE statement. PCTSUM allows you to specify EP_AMT as the denominator.&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc tabulate data=test_data f=10.2;&lt;BR /&gt;
var ep_amt loss_amt;&lt;BR /&gt;
class layer asset_range reinsurer_group;&lt;BR /&gt;
table layer * asset_range, &lt;BR /&gt;
      reinsurer_group * (ep_amt loss_amt loss_amt*pctsum&amp;lt;ep_amt&amp;gt;)&lt;BR /&gt;
       / box='Custom Denom';&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 13 Apr 2011 16:19:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-pctsum-by-group/m-p/49515#M13452</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-04-13T16:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate pctsum by group?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-pctsum-by-group/m-p/49516#M13453</link>
      <description>You are amazing as usual!  Thanks for your help (again) &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Wed, 13 Apr 2011 17:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-pctsum-by-group/m-p/49516#M13453</guid>
      <dc:creator>FrankE</dc:creator>
      <dc:date>2011-04-13T17:24:33Z</dc:date>
    </item>
  </channel>
</rss>

