<?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: Rank function missing few ranks in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Rank-function-missing-few-ranks/m-p/313206#M68018</link>
    <description>&lt;P&gt;Can't say without seeing the data. One way to break the ties is to add a small random component to the data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data source_data_rnd;
set source_data;
num_var_rnd = num_var + rand("UNIFORM")*0.00001;
run;

proc rank data = source_data_rnd out=output(drop=num_var_rnd) groups=10;
var num_var_rnd;
ranks num_var_1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 21 Nov 2016 19:21:59 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-11-21T19:21:59Z</dc:date>
    <item>
      <title>Rank function missing few ranks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rank-function-missing-few-ranks/m-p/313162#M67995</link>
      <description>&lt;P&gt;I am trying to use Rank function on a numeric variable &lt;STRONG&gt;num_var&lt;/STRONG&gt;&amp;nbsp;to get a new variable&amp;nbsp;&lt;STRONG&gt;num_var_1&amp;nbsp;&lt;/STRONG&gt;with ranks. In my output I get the new variable&amp;nbsp;&lt;STRONG&gt;num_var_1&amp;nbsp;&lt;/STRONG&gt;with ranks 0,2,3,4,5,6,7,8,9. &amp;nbsp; &amp;nbsp;Rank 1 is missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc rank data = source_data out = output&amp;nbsp;groups =10 ties = low;&lt;BR /&gt;var num_var.;&lt;BR /&gt;ranks num_var_1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could be the possible reason for this?&lt;/P&gt;&lt;P&gt;Thanks in advance for help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhishek&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 17:20:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rank-function-missing-few-ranks/m-p/313162#M67995</guid>
      <dc:creator>abhim701</dc:creator>
      <dc:date>2016-11-21T17:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function missing few ranks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rank-function-missing-few-ranks/m-p/313172#M68003</link>
      <description>&lt;P&gt;There must be a large number of ties at the minimum value, more than 20% of your data. Ties=low will give rank 0 to those&amp;nbsp;obs.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 17:48:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rank-function-missing-few-ranks/m-p/313172#M68003</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-11-21T17:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function missing few ranks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rank-function-missing-few-ranks/m-p/313179#M68007</link>
      <description>&lt;P&gt;Thanks for the help! I got it now.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 18:16:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rank-function-missing-few-ranks/m-p/313179#M68007</guid>
      <dc:creator>abhim701</dc:creator>
      <dc:date>2016-11-21T18:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function missing few ranks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rank-function-missing-few-ranks/m-p/313186#M68009</link>
      <description>&lt;P&gt;I tried&lt;STRONG&gt; ties = high.&lt;/STRONG&gt; This also gives me the same output.&lt;/P&gt;&lt;P&gt;0,2,3,4,5,6,7,8,9.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was expecting&amp;nbsp;&lt;/P&gt;&lt;P&gt;1,2,3,4,5,6,7,8,9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any comments?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 18:33:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rank-function-missing-few-ranks/m-p/313186#M68009</guid>
      <dc:creator>abhim701</dc:creator>
      <dc:date>2016-11-21T18:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function missing few ranks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rank-function-missing-few-ranks/m-p/313206#M68018</link>
      <description>&lt;P&gt;Can't say without seeing the data. One way to break the ties is to add a small random component to the data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data source_data_rnd;
set source_data;
num_var_rnd = num_var + rand("UNIFORM")*0.00001;
run;

proc rank data = source_data_rnd out=output(drop=num_var_rnd) groups=10;
var num_var_rnd;
ranks num_var_1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Nov 2016 19:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rank-function-missing-few-ranks/m-p/313206#M68018</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-11-21T19:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function missing few ranks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rank-function-missing-few-ranks/m-p/313327#M68057</link>
      <description>&lt;PRE&gt;
Try
 ties = dense

&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Nov 2016 02:37:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rank-function-missing-few-ranks/m-p/313327#M68057</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-22T02:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function missing few ranks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rank-function-missing-few-ranks/m-p/313495#M68126</link>
      <description>&lt;P&gt;&amp;nbsp;For a discussion of some common reasons this could happen, see the article &lt;A href="http://blogs.sas.com/content/iml/2014/11/05/binning-quantiles-rounded-data.html" target="_self"&gt;"Binning data by quantiles."&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 15:31:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rank-function-missing-few-ranks/m-p/313495#M68126</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-11-22T15:31:45Z</dc:date>
    </item>
  </channel>
</rss>

