<?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: Calculate averages by percentiles in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calculate-averages-by-percentiles/m-p/438186#M109216</link>
    <description>&lt;P&gt;It can be done, but this is the hard way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead, use PROC RANK to create an output data set with percentile assigned.&amp;nbsp; You won't have the cutoffs, but you won't need them either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 17 Feb 2018 19:48:02 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-02-17T19:48:02Z</dc:date>
    <item>
      <title>Calculate averages by percentiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-averages-by-percentiles/m-p/438183#M109215</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to calculate the average of costs at&amp;nbsp;each percentile based on contracts. I got as far as calculating the percentile limits, but this gives me a dataset with varilables; P_1, P-2, ... P_100. I need to somehow merge these into my original dataset and then use proc means I guess to calculate the averege cost per percentile.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's the most efficient way of doing this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; claims;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; client year cost contract;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;18 2011 589.92 10.2&lt;/P&gt;&lt;P&gt;19 2010 1629.8 11.5&lt;/P&gt;&lt;P&gt;20 2011 1813.29 2.3&lt;/P&gt;&lt;P&gt;21 2012 412.06 3.2&lt;/P&gt;&lt;P&gt;22 2012 219.82 0.4&lt;/P&gt;&lt;P&gt;23 2010 3669.98 5.9&lt;/P&gt;&lt;P&gt;24 2012 4879.63 6.8&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;univariate&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=claims &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;noprint&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; contract;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;pctlpre&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=P_ &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;pctlpts&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; to &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;100&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 19:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-averages-by-percentiles/m-p/438183#M109215</guid>
      <dc:creator>GKati</dc:creator>
      <dc:date>2018-02-17T19:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate averages by percentiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-averages-by-percentiles/m-p/438186#M109216</link>
      <description>&lt;P&gt;It can be done, but this is the hard way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead, use PROC RANK to create an output data set with percentile assigned.&amp;nbsp; You won't have the cutoffs, but you won't need them either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 19:48:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-averages-by-percentiles/m-p/438186#M109216</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-17T19:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate averages by percentiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-averages-by-percentiles/m-p/438187#M109217</link>
      <description>&lt;P&gt;Use PROC STDIZE to get results in long format and merge accordingly as in the article below &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2013/10/23/percentiles-in-a-tabular-format.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2013/10/23/percentiles-in-a-tabular-format.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 19:49:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-averages-by-percentiles/m-p/438187#M109217</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-02-17T19:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate averages by percentiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-averages-by-percentiles/m-p/438196#M109223</link>
      <description>Perfect! Thx</description>
      <pubDate>Sat, 17 Feb 2018 21:11:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-averages-by-percentiles/m-p/438196#M109223</guid>
      <dc:creator>GKati</dc:creator>
      <dc:date>2018-02-17T21:11:18Z</dc:date>
    </item>
  </channel>
</rss>

