<?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 by group and show the cutoffs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/rank-by-group-and-show-the-cutoffs/m-p/727813#M226435</link>
    <description>I don't think there's a good way to do this all in one step except a manual data step...curious to see other answers.&lt;BR /&gt;&lt;BR /&gt;Assuming you don't want that, I'd use PROC RANKS and then pass the results to PROC MEANS and find the MIN/MAX for each RANK and merge that back into my output from PROC RANK. &lt;BR /&gt;&lt;BR /&gt;Example of adding average value to a data set - modify it to return min/max instead of average.&lt;BR /&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/add_average_value_to_dataset.sas" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/add_average_value_to_dataset.sas&lt;/A&gt;</description>
    <pubDate>Fri, 19 Mar 2021 17:05:07 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-03-19T17:05:07Z</dc:date>
    <item>
      <title>rank by group and show the cutoffs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/rank-by-group-and-show-the-cutoffs/m-p/727801#M226431</link>
      <description>&lt;P&gt;Hello, I need to rank a numeric variable into 5 groups by another categorical variable and also get the cutoffs. I currently have this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc rank data=dsout out=ranks groups=5;
   by var2;
   var var1;
   ranks var1_rank;
run;&lt;/PRE&gt;
&lt;P&gt;I have 2 columns now (var1, var2), and I want the output to be 4 columns. The var1 ranks by var2 (var1_rank) derived using the above code and the cutoff values (range) that would take a value like '0.0999254969 &amp;lt;= x1 &amp;lt; 0.1993986319' based on how the ranks are calculated. Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 16:34:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/rank-by-group-and-show-the-cutoffs/m-p/727801#M226431</guid>
      <dc:creator>asasha</dc:creator>
      <dc:date>2021-03-19T16:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: rank by group and show the cutoffs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/rank-by-group-and-show-the-cutoffs/m-p/727813#M226435</link>
      <description>I don't think there's a good way to do this all in one step except a manual data step...curious to see other answers.&lt;BR /&gt;&lt;BR /&gt;Assuming you don't want that, I'd use PROC RANKS and then pass the results to PROC MEANS and find the MIN/MAX for each RANK and merge that back into my output from PROC RANK. &lt;BR /&gt;&lt;BR /&gt;Example of adding average value to a data set - modify it to return min/max instead of average.&lt;BR /&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/add_average_value_to_dataset.sas" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/add_average_value_to_dataset.sas&lt;/A&gt;</description>
      <pubDate>Fri, 19 Mar 2021 17:05:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/rank-by-group-and-show-the-cutoffs/m-p/727813#M226435</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-19T17:05:07Z</dc:date>
    </item>
  </channel>
</rss>

