<?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: Calculating Percentile across observations and excluding missing values in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Calculating-Percentile-across-observations-and-excluding-missing/m-p/254033#M13414</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The corrected code is below and still does not replicate the problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
array pct(100) pct1-pct100 (1:100);
x=pctl(50, of pct(*));

do i=20 to 30;
pct(i)=.;
end;

y=pctl(50, of pct(*));
z=pctl(50, of pct1--pct100);
q=pctl(50, pct1, pct2, pct3, pct21, pct25, pct29, pct30, pct50, pct99, pct100);

keep x y z q;

run;

proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/75695"&gt;@tts﻿&lt;/a&gt;&amp;nbsp;Have you been able to replicate your issue?&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2016 02:17:47 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-03-03T02:17:47Z</dc:date>
    <item>
      <title>Calculating Percentile across observations and excluding missing values</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculating-Percentile-across-observations-and-excluding-missing/m-p/253580#M13384</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wondering whether there is a way to calculate percentile across variables for each observation, and excludes missing values in the calculation?&lt;/P&gt;&lt;P&gt;The percentile function seems to work but if there is just a single missing value within all the variables then the result is a missing variable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only workaround I was able to find was to achieve this in Excel, as my dataset fortunately wasn't too large.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 20:11:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculating-Percentile-across-observations-and-excluding-missing/m-p/253580#M13384</guid>
      <dc:creator>tts</dc:creator>
      <dc:date>2016-03-01T20:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Percentile across observations and excluding missing values</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculating-Percentile-across-observations-and-excluding-missing/m-p/253588#M13386</link>
      <description>&lt;P&gt;I would recommend a transpose of your data and then using a more robust procedure such as proc univariate or proc means to calculate the percentile.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, the behaviour your describing is not consistent with the percentile documentation, which states:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The PCTL function returns the percentile of the &lt;U&gt;&lt;STRONG&gt;nonmissing values&lt;/STRONG&gt;&lt;/U&gt; corresponding to the percentage. I can't replicate that behaviour as well, can you post a sample of your data where this was occuring?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
array pct(100) pct1-pct100 (1:100);
x=pctl(50, of pct(*));

do i=20 to 30;
pct(i)=.;
end;

y=pctl(50, of pct(*));

keep x y;

run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Mar 2016 20:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculating-Percentile-across-observations-and-excluding-missing/m-p/253588#M13386</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-01T20:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Percentile across observations and excluding missing values</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculating-Percentile-across-observations-and-excluding-missing/m-p/253625#M13389</link>
      <description>My data is structured similarly to your test dataset, however my variable names are not standardized. There is no standardization as they are various company tickers on NASDAQ.&lt;BR /&gt;&lt;BR /&gt;The way you define the variables to calculate percentile across would not work in my instance, correct?&lt;BR /&gt;&lt;BR /&gt;What I had tried was :&lt;BR /&gt;&lt;BR /&gt;percentile= PCTL(95,A--VLU); with A and VLU being the first and last variables I am interested in calculating percentile across.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Mar 2016 22:52:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculating-Percentile-across-observations-and-excluding-missing/m-p/253625#M13389</guid>
      <dc:creator>tts</dc:creator>
      <dc:date>2016-03-01T22:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Percentile across observations and excluding missing values</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculating-Percentile-across-observations-and-excluding-missing/m-p/253629#M13391</link>
      <description>&lt;P&gt;If you can define it that way, you could also define your array similarily.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array stocks(*) A--VLU;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;At any rate, I still can't replicate your issue. Please post your code and sample data that replicates your problem. I'm guessing you actually have some other issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
array pct(100) pct1-pct100 (1:100);
x=pctl(50, of pct(*));

do i=20 to 30;
pct(i)=.;
end;

y=pctl(50, of pct(*));
z=pctl(95, pct1--pct100);

keep x y z;

run;

proc print;run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 23:04:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculating-Percentile-across-observations-and-excluding-missing/m-p/253629#M13391</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-01T23:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Percentile across observations and excluding missing values</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculating-Percentile-across-observations-and-excluding-missing/m-p/253720#M13395</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I think you should insert an "of" into your definition of z. Otherwise, the 95th percentile of a single value (singleton set), pct1--pct100=pct1+pct100=101, will be calculated.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 09:15:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculating-Percentile-across-observations-and-excluding-missing/m-p/253720#M13395</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-03-02T09:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Percentile across observations and excluding missing values</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculating-Percentile-across-observations-and-excluding-missing/m-p/254033#M13414</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The corrected code is below and still does not replicate the problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
array pct(100) pct1-pct100 (1:100);
x=pctl(50, of pct(*));

do i=20 to 30;
pct(i)=.;
end;

y=pctl(50, of pct(*));
z=pctl(50, of pct1--pct100);
q=pctl(50, pct1, pct2, pct3, pct21, pct25, pct29, pct30, pct50, pct99, pct100);

keep x y z q;

run;

proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/75695"&gt;@tts﻿&lt;/a&gt;&amp;nbsp;Have you been able to replicate your issue?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 02:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculating-Percentile-across-observations-and-excluding-missing/m-p/254033#M13414</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-03T02:17:47Z</dc:date>
    </item>
  </channel>
</rss>

