<?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: Percentile calculation for a table in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/233913#M54858</link>
    <description>&lt;P&gt;Sincere apologies for a delayed reply.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was implemented this scenario in excel, the values weren't similar. I almost got 99 different values when I used the PERCENTILE.INC function over the 6 variables I mentioned earlier in the post.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another point, would the logic be same if I want to get 100 percentiles of 20 variables instead of 6? 6 was just an example.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Varun.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Nov 2015 21:33:03 GMT</pubDate>
    <dc:creator>varun1220</dc:creator>
    <dc:date>2015-11-09T21:33:03Z</dc:date>
    <item>
      <title>Percentile calculation for a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/232832#M54755</link>
      <description>&lt;P&gt;I have a table of 6 columns and 8760 rows filled with numerical values. I need to find 99 percentiles for each row which has 6 values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the gist of the table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 288pt;" border="0" width="384" cellspacing="0" cellpadding="0"&gt;&lt;COLGROUP&gt;&lt;COL style="width: 48pt;" span="6" width="64" /&gt; &lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl63" style="height: 15.0pt; width: 48pt;"&gt;Load_04&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;Load_05&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;Load_06&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;Load_07&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;Load_08&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;Load_09&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;2433.896&lt;/TD&gt;
&lt;TD align="right"&gt;2323.323&lt;/TD&gt;
&lt;TD align="right"&gt;2720.163&lt;/TD&gt;
&lt;TD align="right"&gt;2708.686&lt;/TD&gt;
&lt;TD align="right"&gt;2742.605&lt;/TD&gt;
&lt;TD align="right"&gt;2925.509&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;2381.1&lt;/TD&gt;
&lt;TD align="right"&gt;2299.548&lt;/TD&gt;
&lt;TD align="right"&gt;2649.212&lt;/TD&gt;
&lt;TD align="right"&gt;2576.808&lt;/TD&gt;
&lt;TD align="right"&gt;2638.918&lt;/TD&gt;
&lt;TD align="right"&gt;2717.989&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;2421.829&lt;/TD&gt;
&lt;TD align="right"&gt;2376.882&lt;/TD&gt;
&lt;TD align="right"&gt;2595.548&lt;/TD&gt;
&lt;TD align="right"&gt;2474.217&lt;/TD&gt;
&lt;TD align="right"&gt;2604.292&lt;/TD&gt;
&lt;TD align="right"&gt;2749.657&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;2485.082&lt;/TD&gt;
&lt;TD align="right"&gt;2487.375&lt;/TD&gt;
&lt;TD align="right"&gt;2595.651&lt;/TD&gt;
&lt;TD align="right"&gt;2434.356&lt;/TD&gt;
&lt;TD align="right"&gt;2579.163&lt;/TD&gt;
&lt;TD align="right"&gt;2728.158&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;2559.993&lt;/TD&gt;
&lt;TD align="right"&gt;2573.468&lt;/TD&gt;
&lt;TD align="right"&gt;2607.336&lt;/TD&gt;
&lt;TD align="right"&gt;2459.65&lt;/TD&gt;
&lt;TD align="right"&gt;2602.624&lt;/TD&gt;
&lt;TD align="right"&gt;
&lt;P&gt;2795.224&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to calculate all the percentiles for each row for combined six values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ex: For first row, I want the 99 percentiles of the values&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 288pt;" border="0" width="384" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;2433.896&lt;/TD&gt;
&lt;TD align="right"&gt;2323.323&lt;/TD&gt;
&lt;TD align="right"&gt;2720.163&lt;/TD&gt;
&lt;TD align="right"&gt;2708.686&lt;/TD&gt;
&lt;TD align="right"&gt;2742.605&lt;/TD&gt;
&lt;TD align="right"&gt;2925.509&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp; together.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Similarly for each row.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried proc univariate for this purpose, the result is not for every row but for every column. Hence I tried transposing the table but SAS can't take 8760 variables at a time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kindly suggest a solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot in advance.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Varun.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 00:33:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/232832#M54755</guid>
      <dc:creator>varun1220</dc:creator>
      <dc:date>2015-11-04T00:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Percentile calculation for a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/232838#M54757</link>
      <description>&lt;P&gt;i believe we need&amp;nbsp; to transpose data to columns and then use proc means to calculate the percentile&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Load_04 	Load_05 	Load_06 	Load_07 	Load_08 	Load_09;
cards;
2433.896 	2323.323 	2720.163 	2708.686 	2742.605 	2925.509
2381.1 	2299.548 	2649.212 	2576.808 	     2638.918 	    2717.989
2421.829 	2376.882 	2595.548 	2474.217 	2604.292 	2749.657
2485.082 	2487.375 	2595.651 	2434.356 	2579.163 	2728.158
2559.993 	2573.468 	2607.336 	2459.65 	2602.624 	2795.224
;

proc transpose data=have out=want;
var  Load_04 	Load_05 	Load_06 	Load_07 	Load_08 	Load_09;
run;

proc means data= want ;
var  col1-col5;
output out=p99 p99=/autoname;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jag&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2015 00:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/232838#M54757</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-11-03T00:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Percentile calculation for a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/232840#M54758</link>
      <description>&lt;P&gt;Use pctl function to get percentile for each row:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want(drop=i);&lt;BR /&gt;set have;&lt;BR /&gt;array load(*) load:;&lt;BR /&gt;do i=1 to dim(load);&lt;BR /&gt;p_99=pctl(99,of load(*));&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2015 01:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/232840#M54758</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2015-11-03T01:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Percentile calculation for a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/232897#M54774</link>
      <description>The 99th percentile will either be the maximum or the second largest value, when you have only 6 values. Look at using the largest or max function as it may be more efficient than the percentile function.</description>
      <pubDate>Tue, 03 Nov 2015 15:25:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/232897#M54774</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-11-03T15:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Percentile calculation for a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/232934#M54780</link>
      <description>&lt;P&gt;As Reeza pointed out, this exercise doesn't make sense. In general, you need more than 100 values before the 99th percentile becomes meaningful. It looks like your data does not contain duplicate or rounded values, so the only relevant percentiles are 16.6th, 33.3th,...,and 87.6th.&amp;nbsp; If you want the max of each row, that is easy to do with the DATA step and an array.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2015 17:47:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/232934#M54780</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-11-03T17:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Percentile calculation for a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/232998#M54783</link>
      <description>&lt;P&gt;I need to calculate all the 99 percentiles for my assignment as I'm performing probablistic forecasting.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2015 23:40:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/232998#M54783</guid>
      <dc:creator>varun1220</dc:creator>
      <dc:date>2015-11-03T23:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Percentile calculation for a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/232999#M54784</link>
      <description>&lt;P&gt;Thank you for the asnwer. This seems very helpful.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please tell me what does the function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;array load(*)load:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What does load(*) stand for?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kindly reply as per your convenience.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2015 23:45:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/232999#M54784</guid>
      <dc:creator>varun1220</dc:creator>
      <dc:date>2015-11-03T23:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Percentile calculation for a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/233001#M54786</link>
      <description>&lt;P&gt;Thank you Jagdish. This is a helpful answer.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Varun.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 00:09:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/233001#M54786</guid>
      <dc:creator>varun1220</dc:creator>
      <dc:date>2015-11-04T00:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Percentile calculation for a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/233016#M54789</link>
      <description>&lt;P&gt;&lt;SPAN&gt;array load(*) load:;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;load is name of array and (*) indicates the dimension of array, represents number of elements in the array which is 6 in this case. If we indicate dimension of the array using (*) then SAS determines demension of the array by counting number of elements.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;load: repr&lt;/SPAN&gt;&lt;SPAN&gt;esents 6 elements in the array (load1 load2 load3 load4 load5 load6)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;array load(*) load:; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;can also be written as&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;array load(6) load1 load2 load3 load4 load5 load6;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 03:29:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/233016#M54789</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2015-11-04T03:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Percentile calculation for a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/233113#M54798</link>
      <description>Sometimes its good to think about why you do what you're doing. Would your answer be different in this case if you used the 95th percentile? Or 90th percentile? Most likely not because you only have 6 variables so they would all end up being the same number.</description>
      <pubDate>Wed, 04 Nov 2015 16:33:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/233113#M54798</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-11-04T16:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Percentile calculation for a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/233913#M54858</link>
      <description>&lt;P&gt;Sincere apologies for a delayed reply.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was implemented this scenario in excel, the values weren't similar. I almost got 99 different values when I used the PERCENTILE.INC function over the 6 variables I mentioned earlier in the post.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another point, would the logic be same if I want to get 100 percentiles of 20 variables instead of 6? 6 was just an example.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Varun.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 21:33:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/233913#M54858</guid>
      <dc:creator>varun1220</dc:creator>
      <dc:date>2015-11-09T21:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Percentile calculation for a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/233914#M54859</link>
      <description>&lt;P&gt;Great. Thank you so much.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 21:34:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/233914#M54859</guid>
      <dc:creator>varun1220</dc:creator>
      <dc:date>2015-11-09T21:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Percentile calculation for a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/233919#M54860</link>
      <description>100 percentiles is the maximum. &lt;BR /&gt;&lt;BR /&gt;Percentiles have various definitions on how to calculate them, mostly around how to handle ties.&lt;BR /&gt;&lt;BR /&gt;SAS supports 5 definitions through proc univariate and I don't think any align to Excel definitions. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/procstat/63104/HTML/default/viewer.htm#procstat_univariate_sect028.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/procstat/63104/HTML/default/viewer.htm#procstat_univariate_sect028.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Nov 2015 21:48:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/233919#M54860</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-11-09T21:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Percentile calculation for a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/235822#M55160</link>
      <description>&lt;P&gt;I am in situation where I have more than 99 values and I need calculate the 99 percentiles of each of set of values. The table consists of 8760 rows and more than 100 columns.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to calculate 99 percentiles for each row.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kindly revert as per your convenience.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2015 03:20:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/235822#M55160</guid>
      <dc:creator>varun1220</dc:creator>
      <dc:date>2015-11-21T03:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Percentile calculation for a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/235861#M55169</link>
      <description>The answers from Nov 2 are correct. Either transpose your data and use proc means or use the percentile function. If those dont work you need to explain why so we can help further.</description>
      <pubDate>Sat, 21 Nov 2015 18:35:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Percentile-calculation-for-a-table/m-p/235861#M55169</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-11-21T18:35:19Z</dc:date>
    </item>
  </channel>
</rss>

