<?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: Creating continuous percentile value for all observations in data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Creating-continuous-percentile-value-for-all-observations-in/m-p/466259#M70619</link>
    <description>&lt;P&gt;Percentiles by definition break the data up into uniform groups.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think you want a histogram, I think you want the CDF from PROC UNIVARIATE on the raw data based on your comments. It does not match your graph though.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 May 2018 21:21:24 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-05-30T21:21:24Z</dc:date>
    <item>
      <title>Creating continuous percentile value for all observations in data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-continuous-percentile-value-for-all-observations-in/m-p/466179#M70611</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BMI percentile.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20868i51C5BC7469EFA050/image-size/large?v=v2&amp;amp;px=999" role="button" title="BMI percentile.png" alt="BMI percentile.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'd like to calculate percentile of BMI&amp;nbsp;of all&amp;nbsp;observation (person)&amp;nbsp; in data. Below is my attempt. I'm puzzled with resulting histogram on percentile (rank_BMI)&amp;nbsp;. People with higher BMI percentile are at higher risk of being obese et.c. However, how is it possible that all percentiles are uniformly distributed &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp; Correct and expected&amp;nbsp;"percentile of BMI for age" is also shown in the image below &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; proc rank data=Mydata groups=100 out=ranked;
  var BMI;
  ranks rank_BMI;
 run;

 proc univariate data=ranked noprint;
   histogram rank_BMI/
      normal(noprint)
      nocurvelegend;
label rank_BMI="pctl of BMI"; 
run;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BMI percentile.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20866i083002BBEECD4E2C/image-size/large?v=v2&amp;amp;px=999" role="button" title="BMI percentile.png" alt="BMI percentile.png" /&gt;&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 18:25:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-continuous-percentile-value-for-all-observations-in/m-p/466179#M70611</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-05-30T18:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating continuous percentile value for all observations in data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-continuous-percentile-value-for-all-observations-in/m-p/466183#M70613</link>
      <description>&lt;P&gt;I failed to customize this solution to my data. Macro didn't work for me.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sgf/2017/07/21/selecting-the-top-n-and-bottom-n-of-observations-from-a-data-set/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2017/07/21/selecting-the-top-n-and-bottom-n-of-observations-from-a-data-set/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 18:27:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-continuous-percentile-value-for-all-observations-in/m-p/466183#M70613</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-05-30T18:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating continuous percentile value for all observations in data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-continuous-percentile-value-for-all-observations-in/m-p/466251#M70618</link>
      <description>&lt;P&gt;The issue with the shown plot is that you are sort of misunderstanding what the Proc Ranks is doing. Please see this result from your code on some&amp;nbsp;data with two different distributions.&lt;/P&gt;
&lt;PRE&gt;data example;
   do i= 1 to 10000;
      val = rand('normal',0,1);
      val2 = rand('exponential');
      output;
   end;
run;

proc rank data=example groups=100 out=ranked;
   var val val2;
   ranks rank_val rank_val2;
run;

proc univariate data=ranked noprint ;
   histogram rank_val/
      normal(noprint)
      nocurvelegend;
   histogram val/
      normal(noprint)
      nocurvelegend;
   label val='raw data normal';
   label rank_val="pctl of normal VAL";
   histogram rank_val2/
      normal(noprint)
      nocurvelegend;
   histogram val2/
      normal(noprint)
      nocurvelegend;
   label val2='raw data exponential';
   label rank_val2="pctl of exponential VAL2";
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending a number of setting your univariate graph of rank_val may look a bit odd depending on the number of bins univariate displays. The question I would actually ask is more why isn't your percentile actually flatter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What does the histogram of your BMI variable look like?&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 20:51:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-continuous-percentile-value-for-all-observations-in/m-p/466251#M70618</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-30T20:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating continuous percentile value for all observations in data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-continuous-percentile-value-for-all-observations-in/m-p/466259#M70619</link>
      <description>&lt;P&gt;Percentiles by definition break the data up into uniform groups.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think you want a histogram, I think you want the CDF from PROC UNIVARIATE on the raw data based on your comments. It does not match your graph though.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 21:21:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-continuous-percentile-value-for-all-observations-in/m-p/466259#M70619</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-30T21:21:24Z</dc:date>
    </item>
  </channel>
</rss>

