<?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: Issues with PROC RANK in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530138#M73699</link>
    <description>&lt;P&gt;Show us your code. Click on the running man icon and paste the code into the window that appears (DO NOT SKIP THIS STEP)&lt;/P&gt;</description>
    <pubDate>Fri, 25 Jan 2019 18:07:08 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-01-25T18:07:08Z</dc:date>
    <item>
      <title>Issues with PROC RANK</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530137#M73698</link>
      <description>&lt;P&gt;I am using PROC RANK with by group processing (pre-sorted). Even though the values are different, PROC RANK returns all 1s for the rank values. Many values are being ranked by the same by group processing. It does not happen with all variables, but it does occur with several of them.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the list of example values for a parameter within a single by group (all are rank = 1 in the output dataset):&lt;/P&gt;&lt;P&gt;6.5&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;3.4&lt;/P&gt;&lt;P&gt;0.77777&lt;/P&gt;&lt;P&gt;0.33333&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;0.88888&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;0.666666&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 18:03:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530137#M73698</guid>
      <dc:creator>Doug____</dc:creator>
      <dc:date>2019-01-25T18:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with PROC RANK</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530138#M73699</link>
      <description>&lt;P&gt;Show us your code. Click on the running man icon and paste the code into the window that appears (DO NOT SKIP THIS STEP)&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 18:07:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530138#M73699</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-25T18:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with PROC RANK</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530139#M73700</link>
      <description>And the log please.</description>
      <pubDate>Fri, 25 Jan 2019 18:11:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530139#M73700</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-25T18:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with PROC RANK</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530144#M73701</link>
      <description>&lt;P&gt;Show us your code please.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 18:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530144#M73701</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-25T18:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with PROC RANK</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530145#M73702</link>
      <description>&lt;P&gt;I cannot replicate your issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input X;
cards;
6.5
0
3.4
0.77777
0.33333
1
2
0
0
0.88888
2
0
0.666666
;;;;

proc rank data=have out=want groups=4;
var x;
Ranks x_rank;
run;

proc freq data=want;
table x_rank;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Freq: One-Way Frequencies" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="5" scope="colgroup"&gt;Rank for Variable X&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r b header" scope="col"&gt;x_rank&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Frequency&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Percent&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Cumulative&lt;BR /&gt;Frequency&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Cumulative&lt;BR /&gt;Percent&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;0&lt;/TH&gt;
&lt;TD class="r data"&gt;4&lt;/TD&gt;
&lt;TD class="r data"&gt;30.77&lt;/TD&gt;
&lt;TD class="r data"&gt;4&lt;/TD&gt;
&lt;TD class="r data"&gt;30.77&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="r data"&gt;2&lt;/TD&gt;
&lt;TD class="r data"&gt;15.38&lt;/TD&gt;
&lt;TD class="r data"&gt;6&lt;/TD&gt;
&lt;TD class="r data"&gt;46.15&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="r data"&gt;3&lt;/TD&gt;
&lt;TD class="r data"&gt;23.08&lt;/TD&gt;
&lt;TD class="r data"&gt;9&lt;/TD&gt;
&lt;TD class="r data"&gt;69.23&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="r data"&gt;4&lt;/TD&gt;
&lt;TD class="r data"&gt;30.77&lt;/TD&gt;
&lt;TD class="r data"&gt;13&lt;/TD&gt;
&lt;TD class="r data"&gt;100.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10429"&gt;@Doug____&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am using PROC RANK with by group processing (pre-sorted). Even though the values are different, PROC RANK returns all 1s for the rank values. Many values are being ranked by the same by group processing. It does not happen with all variables, but it does occur with several of them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the list of example values for a parameter within a single by group (all are rank = 1 in the output dataset):&lt;/P&gt;
&lt;P&gt;6.5&lt;/P&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;P&gt;3.4&lt;/P&gt;
&lt;P&gt;0.77777&lt;/P&gt;
&lt;P&gt;0.33333&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;P&gt;0.88888&lt;/P&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;P&gt;0.666666&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Jan 2019 18:40:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530145#M73702</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-25T18:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with PROC RANK</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530168#M73703</link>
      <description>&lt;P&gt;proc rank data = CM_BY_FA_S out =&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;CM_BY_FA_ORG_RANKS&lt;/SPAN&gt; descending ties = low;&lt;/P&gt;&lt;P&gt;by Manager;&lt;/P&gt;&lt;P&gt;VAR&amp;nbsp;&lt;/P&gt;&lt;P&gt;Var1&lt;/P&gt;&lt;P&gt;Var2&lt;/P&gt;&lt;P&gt;Var3, etc.;&lt;/P&gt;&lt;P&gt;Ranks&lt;/P&gt;&lt;P&gt;Var1_R&lt;/P&gt;&lt;P&gt;Var2_R&lt;/P&gt;&lt;P&gt;Var3_R, etc.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 48 observations read from the dataset WORK.CM_BY_FA_S.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;NOTE: The data set WORK.CM_BY_FA_ORG_RANKS has 48 observations and 280 variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;NOTE:&amp;nbsp; PROCEDURE RANK used (Total process time):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; real time &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.15 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cpu time &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.07 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are 140 variables to rank in the dataset.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 19:12:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530168#M73703</guid>
      <dc:creator>Doug____</dc:creator>
      <dc:date>2019-01-25T19:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with PROC RANK</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530172#M73704</link>
      <description>Still don't get all 1s. &lt;BR /&gt;&lt;BR /&gt;You can use this macro if you want to more easily get the ranks out:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://gist.github.com/statgeek/7cffd06ebc3bc9c78b4f6a5b4538b053" target="_blank"&gt;https://gist.github.com/statgeek/7cffd06ebc3bc9c78b4f6a5b4538b053&lt;/A&gt;</description>
      <pubDate>Fri, 25 Jan 2019 19:14:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530172#M73704</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-25T19:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with PROC RANK</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530185#M73705</link>
      <description>&lt;P&gt;The code you posted uses TIES=LOW. If you are getting all ranks equal to 1, that means that all values for a certain variable are the same. See the following example. The X variable is a constant column, so the ranks are always 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
set Sashelp.Class;
X = 99;
run;

proc rank data = Have out = CM_BY_FA_ORG_RANKS descending ties = low;
VAR   Height   Weight   Age   X;
Ranks Height_R Weight_R Age_R X_R;
run;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Jan 2019 19:41:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Issues-with-PROC-RANK/m-p/530185#M73705</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-01-25T19:41:09Z</dc:date>
    </item>
  </channel>
</rss>

