<?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: double sort proc rank in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/double-sort-proc-rank/m-p/543679#M27216</link>
    <description>&lt;P&gt;You should verify the output of your code using independent method.&amp;nbsp; For example, run your sequential double sort/rank on your test data using excel and then verify that you get the same results with your SAS code.&amp;nbsp; This way you will know for certain that your code is operating as expected.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Mar 2019 23:15:15 GMT</pubDate>
    <dc:creator>donbrockhate</dc:creator>
    <dc:date>2019-03-15T23:15:15Z</dc:date>
    <item>
      <title>double sort proc rank</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/double-sort-proc-rank/m-p/379089#M19904</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I would like to double sort the firms based on their size (TNA) and their concentration. Therefore, first, I need to sort the firms into terciles based on their size &amp;nbsp;and then sort them based on their concentration. I need then to estimate for each generated portfolio its returns and calculate the difference between tercile 3 and tercile 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The aim is to &amp;nbsp;obtain the following :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;concentration: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;size : &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1-small &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3-large&lt;/P&gt;&lt;P&gt;1-diversified&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3- concentrated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tercile 3- tercile1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I would like to know if my sas code is correct and to know how can I calculate tercile3-tercile1 and where to insert that in my sas code.Thank youu in advance&lt;/P&gt;&lt;PRE&gt;proc rank data=doublesort groups=3 out=ranked;
by date;
   var TNA;
   ranks GROUP_1;
run;
proc rank data=ranked groups=3 out=rankedfinal;
by date
   var Concentration;
   ranks GROUP_2;
run;

proc sort data=rankedfinal; by  date GROUP_2 GROUP_1 ;run;

PROC UNIVARIATE DATA= rankedfinal noprint;
var return;
by date GROUP_2 GROUP_1 ;
output out= ga3 mean=MOYENNE;
run;

proc sort data=ga3; by GROUP_2 GROUP_1;run;
proc means data = ga3 noprint ;
  by GROUP_2 GROUP_1 ;
    var moyenne;
    output out = rankedfinal1 mean= ewret;
run;

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 15:45:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/double-sort-proc-rank/m-p/379089#M19904</guid>
      <dc:creator>bera00</dc:creator>
      <dc:date>2017-07-25T15:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: double sort proc rank</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/double-sort-proc-rank/m-p/543679#M27216</link>
      <description>&lt;P&gt;You should verify the output of your code using independent method.&amp;nbsp; For example, run your sequential double sort/rank on your test data using excel and then verify that you get the same results with your SAS code.&amp;nbsp; This way you will know for certain that your code is operating as expected.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2019 23:15:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/double-sort-proc-rank/m-p/543679#M27216</guid>
      <dc:creator>donbrockhate</dc:creator>
      <dc:date>2019-03-15T23:15:15Z</dc:date>
    </item>
  </channel>
</rss>

