<?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: How to rank observations in an arbitrary way? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-rank-observations-in-an-arbitrary-way/m-p/132756#M36118</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use proc format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC FORMAT;&lt;/P&gt;&lt;P&gt;VALUE PERRANK&lt;/P&gt;&lt;P&gt;LOW&amp;nbsp; -&amp;lt; 0.1 = '1'&lt;/P&gt;&lt;P&gt;0.1&amp;nbsp; -&amp;lt; 0.2 = '2'&lt;/P&gt;&lt;P&gt;0.2&amp;nbsp; -&amp;lt; 0.3 = '3'&lt;/P&gt;&lt;P&gt;0.3&amp;nbsp; -&amp;lt; 0.4 = '4'&lt;/P&gt;&lt;P&gt;0.4&amp;nbsp; -&amp;lt; 0.5 = '5'&lt;/P&gt;&lt;P&gt;0.5&amp;nbsp; -&amp;lt; 0.6 = '6'&lt;/P&gt;&lt;P&gt;0.6&amp;nbsp; -&amp;lt; 0.7 = '7'&lt;/P&gt;&lt;P&gt;0.7&amp;nbsp; -&amp;lt; 0.8 = '8'&lt;/P&gt;&lt;P&gt;0.8&amp;nbsp; -&amp;lt; 0.9 = '9'&lt;/P&gt;&lt;P&gt;0.9&amp;nbsp; -&amp;lt; 1.0 = '10'&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA HAVE;&lt;/P&gt;&lt;P&gt;DO I = 1 TO 100000;&lt;/P&gt;&lt;P&gt;PERCENT = RANUNI(0);&lt;/P&gt;&lt;P&gt;OUTPUT;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WANT;&lt;/P&gt;&lt;P&gt;SET HAVE;&lt;/P&gt;&lt;P&gt;RANK = PUT(PERCENT,PERRANK.);&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Sep 2013 02:36:45 GMT</pubDate>
    <dc:creator>Scott_Mitchell</dc:creator>
    <dc:date>2013-09-10T02:36:45Z</dc:date>
    <item>
      <title>How to rank observations in an arbitrary way?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-rank-observations-in-an-arbitrary-way/m-p/132755#M36117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to rank observations based on a specific percent i.e. if the percentage is less than 10%, the observation belongs to rank 1; if less than 20% and more than 10% to rank 2, and so on. So, I cannot use proc rank in this case. I can write it with sql and case, like&lt;/P&gt;&lt;P&gt;case&lt;/P&gt;&lt;P&gt;when percent le .1 a&lt;/P&gt;&lt;P&gt;when percent gt .1 and percent le .2 b ; ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it seems to me that it is inefficient and there must be a better way.&lt;/P&gt;&lt;P&gt;Can anyone please let me know if there is a more straight way of doing this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 00:25:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-rank-observations-in-an-arbitrary-way/m-p/132755#M36117</guid>
      <dc:creator>Shayan2012</dc:creator>
      <dc:date>2013-09-10T00:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to rank observations in an arbitrary way?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-rank-observations-in-an-arbitrary-way/m-p/132756#M36118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use proc format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC FORMAT;&lt;/P&gt;&lt;P&gt;VALUE PERRANK&lt;/P&gt;&lt;P&gt;LOW&amp;nbsp; -&amp;lt; 0.1 = '1'&lt;/P&gt;&lt;P&gt;0.1&amp;nbsp; -&amp;lt; 0.2 = '2'&lt;/P&gt;&lt;P&gt;0.2&amp;nbsp; -&amp;lt; 0.3 = '3'&lt;/P&gt;&lt;P&gt;0.3&amp;nbsp; -&amp;lt; 0.4 = '4'&lt;/P&gt;&lt;P&gt;0.4&amp;nbsp; -&amp;lt; 0.5 = '5'&lt;/P&gt;&lt;P&gt;0.5&amp;nbsp; -&amp;lt; 0.6 = '6'&lt;/P&gt;&lt;P&gt;0.6&amp;nbsp; -&amp;lt; 0.7 = '7'&lt;/P&gt;&lt;P&gt;0.7&amp;nbsp; -&amp;lt; 0.8 = '8'&lt;/P&gt;&lt;P&gt;0.8&amp;nbsp; -&amp;lt; 0.9 = '9'&lt;/P&gt;&lt;P&gt;0.9&amp;nbsp; -&amp;lt; 1.0 = '10'&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA HAVE;&lt;/P&gt;&lt;P&gt;DO I = 1 TO 100000;&lt;/P&gt;&lt;P&gt;PERCENT = RANUNI(0);&lt;/P&gt;&lt;P&gt;OUTPUT;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WANT;&lt;/P&gt;&lt;P&gt;SET HAVE;&lt;/P&gt;&lt;P&gt;RANK = PUT(PERCENT,PERRANK.);&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 02:36:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-rank-observations-in-an-arbitrary-way/m-p/132756#M36118</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2013-09-10T02:36:45Z</dc:date>
    </item>
  </channel>
</rss>

