<?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: Finding Deciles of Multiple Variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Finding-Deciles-of-Multiple-Variables/m-p/661969#M197853</link>
    <description>&lt;P&gt;Proc summary will calculate the overall quantiles.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;proc summary data=have;
   var v1 v2 v3;
   output out=work.summary
      p10= p20= p30= p40= p50= p60= p70= p80= p90= /autoname;
run;&lt;/PRE&gt;
&lt;P&gt;Will create the percentiles indicated. The variables will be named v1_&amp;lt;suffix of the percentile&amp;gt;.&lt;/P&gt;
&lt;P&gt;Put the variables you want on the var statement. Or don't and you will get percentiles of all the numeric variables. There is a technical concern about which definition may be used for the quantiles whic is controlled by the option QNTLDEF= &amp;lt;a value from 1 to 5&amp;gt;. The default is 5. The details have to do with boundaries for the quantiles and tie breakers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to know which decile a particular value falls into use Proc Rank with groups=10. Which will add a ranking variable with values of 0 to 9, 0 indicating the value is in the first decile and 9 in the 10th decile.&lt;/P&gt;
&lt;PRE&gt;proc rank data=have out=want groups=10;
   var v1 v2 v3;
   ranks rv1 rv2 rv3;
run;&lt;/PRE&gt;
&lt;P&gt;The output data set will have the decile for v1 indicated in the variable rv1 and so forth.&lt;/P&gt;
&lt;P&gt;There is an option for the procedure TIES= that has parameter values of high, low, mean or dense which deals with how to assign ranks for tied values. The default is MEAN&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jun 2020 00:19:56 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-06-18T00:19:56Z</dc:date>
    <item>
      <title>Finding Deciles of Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-Deciles-of-Multiple-Variables/m-p/661951#M197843</link>
      <description>&lt;P&gt;Dear All:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I want to get decile groups of multiple variables&lt;/P&gt;&lt;P&gt;The code I am using is&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc sort data = have ; by M ; run;&lt;/P&gt;&lt;P&gt;Data Want; set Have NOBS = NUMOBS ;&lt;/P&gt;&lt;P&gt;Decile_M = FLOOR(_N_*10 /(NUMOBS + 1)) ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I want these deciles for at least 10 more variables.&amp;nbsp; I can find the deciles one variable at a time.&amp;nbsp; Is there an efficient way of constructing the deciles.&lt;/P&gt;&lt;P&gt;Thanx.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Randy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 23:37:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-Deciles-of-Multiple-Variables/m-p/661951#M197843</guid>
      <dc:creator>RandyStan</dc:creator>
      <dc:date>2020-06-17T23:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Deciles of Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-Deciles-of-Multiple-Variables/m-p/661959#M197848</link>
      <description>&lt;P&gt;PROC RANK with the GROUPS=10 option if you want to assign observations to Deciles. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC UNIVARIATE if you just want the decile values.&lt;/P&gt;
&lt;DIV id="tap-translate"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tap-translate"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 18 Jun 2020 00:09:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-Deciles-of-Multiple-Variables/m-p/661959#M197848</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-18T00:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Deciles of Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-Deciles-of-Multiple-Variables/m-p/661964#M197852</link>
      <description>&lt;P&gt;PROC Rank is one of the fastest ways to create deciles in a batch. (The groups=10 option requests the deciles.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc rank data=have out=deciles ties=low descending groups=10;
        var M;
        ranks M_score;
run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I use this paper when I need to grab code to do this myself:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.lexjansen.com/nesug/nesug09/ap/AP01.pdf" target="_blank"&gt;https://www.lexjansen.com/nesug/nesug09/ap/AP01.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 00:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-Deciles-of-Multiple-Variables/m-p/661964#M197852</guid>
      <dc:creator>Nicole_Fox</dc:creator>
      <dc:date>2020-06-18T00:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Deciles of Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-Deciles-of-Multiple-Variables/m-p/661969#M197853</link>
      <description>&lt;P&gt;Proc summary will calculate the overall quantiles.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;proc summary data=have;
   var v1 v2 v3;
   output out=work.summary
      p10= p20= p30= p40= p50= p60= p70= p80= p90= /autoname;
run;&lt;/PRE&gt;
&lt;P&gt;Will create the percentiles indicated. The variables will be named v1_&amp;lt;suffix of the percentile&amp;gt;.&lt;/P&gt;
&lt;P&gt;Put the variables you want on the var statement. Or don't and you will get percentiles of all the numeric variables. There is a technical concern about which definition may be used for the quantiles whic is controlled by the option QNTLDEF= &amp;lt;a value from 1 to 5&amp;gt;. The default is 5. The details have to do with boundaries for the quantiles and tie breakers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to know which decile a particular value falls into use Proc Rank with groups=10. Which will add a ranking variable with values of 0 to 9, 0 indicating the value is in the first decile and 9 in the 10th decile.&lt;/P&gt;
&lt;PRE&gt;proc rank data=have out=want groups=10;
   var v1 v2 v3;
   ranks rv1 rv2 rv3;
run;&lt;/PRE&gt;
&lt;P&gt;The output data set will have the decile for v1 indicated in the variable rv1 and so forth.&lt;/P&gt;
&lt;P&gt;There is an option for the procedure TIES= that has parameter values of high, low, mean or dense which deals with how to assign ranks for tied values. The default is MEAN&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 00:19:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-Deciles-of-Multiple-Variables/m-p/661969#M197853</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-18T00:19:56Z</dc:date>
    </item>
  </channel>
</rss>

