<?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: Output all values greater than 90th percentile? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Output-all-values-greater-than-90th-percentile/m-p/953587#M372533</link>
    <description>&lt;P&gt;Thanks for the prompt reply. &amp;nbsp;I tried your suggested code but didn't get the desired result. I was expecting dataset want to contain only those players with more 163 hits (p90) but dataset want contains all 322 players.&lt;/P&gt;
&lt;P&gt;See below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.baseball;
var nhits;
output out=stats p90=p90;
run;
data want;
set sashelp.baseball;
if nhits &amp;gt;= p90 then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 14 Dec 2024 17:26:04 GMT</pubDate>
    <dc:creator>genemroz</dc:creator>
    <dc:date>2024-12-14T17:26:04Z</dc:date>
    <item>
      <title>Output all values greater than 90th percentile?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-all-values-greater-than-90th-percentile/m-p/953584#M372531</link>
      <description>&lt;P&gt;Is there a way within SAS to output to a new dataset all values of a variable that are, say, above the 90th percentile? &amp;nbsp;I know I can do it with manual intervention by using Proc Univariate to identify the 90th percentile and then, in a separate data step using a WHERE statement, output values greater than the 90th percentile value. &amp;nbsp;But I'm looking for a way to do it that doesn't require the manual intervention of coding the WHERE statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gene&lt;/P&gt;</description>
      <pubDate>Sat, 14 Dec 2024 16:27:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-all-values-greater-than-90th-percentile/m-p/953584#M372531</guid>
      <dc:creator>genemroz</dc:creator>
      <dc:date>2024-12-14T16:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Output all values greater than 90th percentile?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-all-values-greater-than-90th-percentile/m-p/953586#M372532</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have;
     var yourvariablename;
     output out=stats p90=p90;
run;
data want;
    set have;
    if yourvariablename &amp;gt;= p90 then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 14 Dec 2024 17:09:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-all-values-greater-than-90th-percentile/m-p/953586#M372532</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-12-14T17:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Output all values greater than 90th percentile?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-all-values-greater-than-90th-percentile/m-p/953587#M372533</link>
      <description>&lt;P&gt;Thanks for the prompt reply. &amp;nbsp;I tried your suggested code but didn't get the desired result. I was expecting dataset want to contain only those players with more 163 hits (p90) but dataset want contains all 322 players.&lt;/P&gt;
&lt;P&gt;See below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.baseball;
var nhits;
output out=stats p90=p90;
run;
data want;
set sashelp.baseball;
if nhits &amp;gt;= p90 then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 14 Dec 2024 17:26:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-all-values-greater-than-90th-percentile/m-p/953587#M372533</guid>
      <dc:creator>genemroz</dc:creator>
      <dc:date>2024-12-14T17:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Output all values greater than 90th percentile?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-all-values-greater-than-90th-percentile/m-p/953589#M372534</link>
      <description>&lt;P&gt;My bad, left something out, it should be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.baseball;
    var nhits;
    output out=stats p90=p90;
run;
data want;
    if _n_=1 then set stats;
    set sashelp.baseball;
    if nhits &amp;gt;= p90 then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 14 Dec 2024 17:31:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-all-values-greater-than-90th-percentile/m-p/953589#M372534</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-12-14T17:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Output all values greater than 90th percentile?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-all-values-greater-than-90th-percentile/m-p/953590#M372535</link>
      <description>Excellent! Thanks!</description>
      <pubDate>Sat, 14 Dec 2024 17:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-all-values-greater-than-90th-percentile/m-p/953590#M372535</guid>
      <dc:creator>genemroz</dc:creator>
      <dc:date>2024-12-14T17:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Output all values greater than 90th percentile?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-all-values-greater-than-90th-percentile/m-p/953607#M372541</link>
      <description>&lt;P&gt;For having some fun.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc rank data=sashelp.baseball out=temp groups=100;
var nhits;
ranks rank;
run;
data want2;
 set temp;
 if rank&amp;gt;88;
 drop rank;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 15 Dec 2024 03:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-all-values-greater-than-90th-percentile/m-p/953607#M372541</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-12-15T03:16:05Z</dc:date>
    </item>
  </channel>
</rss>

