<?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 The PCTL function in PROC IML in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/The-PCTL-function-in-PROC-IML/m-p/64210#M18253</link>
    <description>The IML manual says that the data step function PCTL will work in PROC&lt;BR /&gt;
IML. Great, except I can make it work in a useful way.&lt;BR /&gt;
&lt;BR /&gt;
If x is a 10x1 vector, then&lt;BR /&gt;
&lt;BR /&gt;
median=pctl(50,x);&lt;BR /&gt;
&lt;BR /&gt;
doesn't really work the way I would hope it works. It gives me a 10x1&lt;BR /&gt;
vector in return, the median of each value in the original matrix x.&lt;BR /&gt;
How non-useful!&lt;BR /&gt;
&lt;BR /&gt;
It does work properly if I write&lt;BR /&gt;
&lt;BR /&gt;
median=pctl(50,x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10]);&lt;BR /&gt;
&lt;BR /&gt;
but this isn't a useful way to do things for general problems where x&lt;BR /&gt;
can be any size.&lt;BR /&gt;
&lt;BR /&gt;
So, is there a way to have the PCTL function work in a useful way in&lt;BR /&gt;
PROC IML?</description>
    <pubDate>Wed, 03 Dec 2008 20:39:14 GMT</pubDate>
    <dc:creator>Paige</dc:creator>
    <dc:date>2008-12-03T20:39:14Z</dc:date>
    <item>
      <title>The PCTL function in PROC IML</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/The-PCTL-function-in-PROC-IML/m-p/64210#M18253</link>
      <description>The IML manual says that the data step function PCTL will work in PROC&lt;BR /&gt;
IML. Great, except I can make it work in a useful way.&lt;BR /&gt;
&lt;BR /&gt;
If x is a 10x1 vector, then&lt;BR /&gt;
&lt;BR /&gt;
median=pctl(50,x);&lt;BR /&gt;
&lt;BR /&gt;
doesn't really work the way I would hope it works. It gives me a 10x1&lt;BR /&gt;
vector in return, the median of each value in the original matrix x.&lt;BR /&gt;
How non-useful!&lt;BR /&gt;
&lt;BR /&gt;
It does work properly if I write&lt;BR /&gt;
&lt;BR /&gt;
median=pctl(50,x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10]);&lt;BR /&gt;
&lt;BR /&gt;
but this isn't a useful way to do things for general problems where x&lt;BR /&gt;
can be any size.&lt;BR /&gt;
&lt;BR /&gt;
So, is there a way to have the PCTL function work in a useful way in&lt;BR /&gt;
PROC IML?</description>
      <pubDate>Wed, 03 Dec 2008 20:39:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/The-PCTL-function-in-PROC-IML/m-p/64210#M18253</guid>
      <dc:creator>Paige</dc:creator>
      <dc:date>2008-12-03T20:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: The PCTL function in PROC IML</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/The-PCTL-function-in-PROC-IML/m-p/64211#M18254</link>
      <description>You can get the median (50th pctl) and the 25th and 75th percentiles by using the MEDIAN or QUARTILE modules in IMLMLIB:&lt;BR /&gt;
&lt;BR /&gt;
proc iml;&lt;BR /&gt;
a = {2 3 2 5 6 8 9 4 12 5}`;&lt;BR /&gt;
med = median(a);&lt;BR /&gt;
print med;&lt;BR /&gt;
&lt;BR /&gt;
q = quartile(a);&lt;BR /&gt;
print q[rowname={"min" "Q1" "median" "Q3" "max"}];&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
For more general percentiles, you can use the SORT call and the RANK function to rank your data.</description>
      <pubDate>Fri, 29 May 2009 20:12:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/The-PCTL-function-in-PROC-IML/m-p/64211#M18254</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2009-05-29T20:12:03Z</dc:date>
    </item>
  </channel>
</rss>

