<?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: Proc Rank quintiles but by year in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-quintiles-but-by-year/m-p/614244#M179494</link>
    <description>&lt;P&gt;Are your data already sorted by year? &amp;nbsp; For instance below is dataset sashelp.cars already sorted by ORIGIN (ASIA EUROPE USA).&amp;nbsp; You can use PROC RANK with a BY statements for all the variables of interest.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.cars out=have;
  by origin;
run;
proc rank data=have out=want   groups=5 ;
  by origin;
  var    Horsepower          Invoice          Length          MSRP          Weight;
  ranks  Horsepower_quintile Invoice_quintile Length_quintile MSRP_quintile Weight_quintile;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For your dataset, just substitute YEAR for origin and your variables for horsepower--weight. &amp;nbsp; But remember the quintile variables will be valued at 0 through 4, not 1 through 5.&amp;nbsp; You may want to run a subsequent data step to add 1 to the quintile variables&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 29 Dec 2019 03:51:57 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2019-12-29T03:51:57Z</dc:date>
    <item>
      <title>Proc Rank quintiles but by year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-quintiles-but-by-year/m-p/614238#M179491</link>
      <description>&lt;P&gt;Hi first time poster, let me know if i need to provide more details.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to use proc rank to create quintiles for 4 different variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data is firm-year observations from 2010-2017. I have four variables i need to separately assign quintiles to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First: Is there a way to have the proc rank consider the year in assigning the quintiles? So it calculates a 2010 set of quintiles and assigns those for the 2010 firm-years, 2011, etc.?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second: Is there a way to have proc rank ignore missing values in creating the quintiles?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;data WORK.MERGERS101;&lt;BR /&gt;infile datalines dsd truncover;&lt;BR /&gt;input EIN:BEST12. NAME:$35. FISYR:BEST12. relativeequity:32. revenueconcentration:32. adminratio:32. operatingmargin:32. dissolver:32.;&lt;BR /&gt;format EIN BEST12. FISYR BEST12.;&lt;BR /&gt;datalines;&lt;BR /&gt;990107223 ACADEMY OF THE PACIFIC 2012 1.3208732899 0.312010507 0.1667243535 -0.005034895 1&lt;BR /&gt;980365458 MOBILE MEMBER CARE TEAM 2016 1.3077040195 0.4397492632 . -0.126948843 1&lt;BR /&gt;990297201 Elementary School Center Hawaii 2010 293.79565217 0 . -13.73478261 1&lt;BR /&gt;990345193 Moolelo Performing Arts Company 2015 0.3496993545 0.5470906723 . -2.045450526 1&lt;BR /&gt;20481994 Warde Health Center Inc 2014 0.0657027419 0.9282159016 0.1512901232 0.0301761733 1&lt;BR /&gt;;;;;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Sun, 29 Dec 2019 00:13:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-quintiles-but-by-year/m-p/614238#M179491</guid>
      <dc:creator>ksmith133333333</dc:creator>
      <dc:date>2019-12-29T00:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Rank quintiles but by year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-quintiles-but-by-year/m-p/614244#M179494</link>
      <description>&lt;P&gt;Are your data already sorted by year? &amp;nbsp; For instance below is dataset sashelp.cars already sorted by ORIGIN (ASIA EUROPE USA).&amp;nbsp; You can use PROC RANK with a BY statements for all the variables of interest.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.cars out=have;
  by origin;
run;
proc rank data=have out=want   groups=5 ;
  by origin;
  var    Horsepower          Invoice          Length          MSRP          Weight;
  ranks  Horsepower_quintile Invoice_quintile Length_quintile MSRP_quintile Weight_quintile;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For your dataset, just substitute YEAR for origin and your variables for horsepower--weight. &amp;nbsp; But remember the quintile variables will be valued at 0 through 4, not 1 through 5.&amp;nbsp; You may want to run a subsequent data step to add 1 to the quintile variables&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Dec 2019 03:51:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-quintiles-but-by-year/m-p/614244#M179494</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2019-12-29T03:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Rank quintiles but by year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-quintiles-but-by-year/m-p/614245#M179495</link>
      <description>&lt;P&gt;It's currently sorted by ein but I can sort it by year. I'll give this a try!&lt;/P&gt;</description>
      <pubDate>Sun, 29 Dec 2019 03:57:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-quintiles-but-by-year/m-p/614245#M179495</guid>
      <dc:creator>ksmith133333333</dc:creator>
      <dc:date>2019-12-29T03:57:26Z</dc:date>
    </item>
  </channel>
</rss>

