<?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: Sorting dataset by percentile in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sorting-dataset-by-percentile/m-p/715165#M220879</link>
    <description>&lt;P&gt;yup i just need to rank them from size 1 to 5 which i have managed to achieve through the proc rank group=5.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to rename each rank? i.e. 0 = small...5=big.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jan 2021 03:59:45 GMT</pubDate>
    <dc:creator>igsteo</dc:creator>
    <dc:date>2021-01-29T03:59:45Z</dc:date>
    <item>
      <title>Sorting dataset by percentile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sorting-dataset-by-percentile/m-p/714896#M220764</link>
      <description>&lt;P&gt;I have to sort a dataset by 5 sizes i.e. size 1 (bottom 20%), size 2 (20-40%), size 3 (40-60%), size 4 (60-80%) and size 5 (top 20%).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I require some feedback as to whether proc univariate or proc rank would be more approriate?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;PRE&gt;proc univariate data=iglib.mktcap6yrs noprint; &lt;BR /&gt;by dsname;&lt;BR /&gt;var CY; &lt;BR /&gt;output out=mktcapsorted pctlpre=P pctlpts=10 to 100 by 20; &lt;BR /&gt;run; &lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc rank  data= mydataset groups=5
    out=rankedset;
   by age;
   var var2;
   ranks varrank;
   ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jan 2021 07:33:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sorting-dataset-by-percentile/m-p/714896#M220764</guid>
      <dc:creator>igsteo</dc:creator>
      <dc:date>2021-01-28T07:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting dataset by percentile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sorting-dataset-by-percentile/m-p/714929#M220774</link>
      <description>To sort the data use PROC SORT.  If all you need is data in order by percentile then your work is done.  The program doesn't assign percentile but it does put the data in the right order.  If you need percentile assignments added to the data, you are not ready yet.  You first need to decide how to handle ties.  If half the data has a value of zero for the analysis variable, you have to choose.  Do you want one percentile that is much larger than the others?  Do you want to split the values so that the same value gets split across two (or more) percentiles?  PROC RANK has options to easily apply any decision you might make along these lines.</description>
      <pubDate>Thu, 28 Jan 2021 09:52:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sorting-dataset-by-percentile/m-p/714929#M220774</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-01-28T09:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting dataset by percentile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sorting-dataset-by-percentile/m-p/715165#M220879</link>
      <description>&lt;P&gt;yup i just need to rank them from size 1 to 5 which i have managed to achieve through the proc rank group=5.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to rename each rank? i.e. 0 = small...5=big.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 03:59:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sorting-dataset-by-percentile/m-p/715165#M220879</guid>
      <dc:creator>igsteo</dc:creator>
      <dc:date>2021-01-29T03:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting dataset by percentile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sorting-dataset-by-percentile/m-p/715452#M220979</link>
      <description>&lt;P&gt;You wouldn't change the data.&amp;nbsp; But you could change how the values print by using PROC FORMAT, then apply the format when printing to translate the five numbers into words.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 20:46:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sorting-dataset-by-percentile/m-p/715452#M220979</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-01-29T20:46:25Z</dc:date>
    </item>
  </channel>
</rss>

