<?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 Observations above the 75th percentile in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117318#M293120</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;Help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;Want only observations above the 75th percentile.&amp;nbsp; Here's the code I tried to use:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;data nicholas._21603_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;set nicholas.combined;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;where&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt; combo contains '21603'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;'50501'n &amp;gt;= pctl(75, '50501'n)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;The first where clause works fine.&amp;nbsp; The second, for the percentile, doesn't.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;Sure hoping for the answer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;Nicholas Kormanik&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Jan 2013 07:07:32 GMT</pubDate>
    <dc:creator>NKormanik</dc:creator>
    <dc:date>2013-01-07T07:07:32Z</dc:date>
    <item>
      <title>Observations above the 75th percentile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117318#M293120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;Help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;Want only observations above the 75th percentile.&amp;nbsp; Here's the code I tried to use:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;data nicholas._21603_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;set nicholas.combined;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;where&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt; combo contains '21603'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;'50501'n &amp;gt;= pctl(75, '50501'n)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;The first where clause works fine.&amp;nbsp; The second, for the percentile, doesn't.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;Sure hoping for the answer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;Nicholas Kormanik&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 07:07:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117318#M293120</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2013-01-07T07:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Observations above the 75th percentile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117319#M293121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;The data step will process only one observation at a time. The function pctl calculates the percentile based on the values that you send into the function, in the function call. A "row-calculation". You would like to calculate the percentile based on a column, and then compare this value to each row.&lt;/P&gt;&lt;P&gt;Mabye something like this?&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;/*Calculate 75 percentile*/&lt;BR /&gt;proc means data=sashelp.class noprint;&lt;BR /&gt;&amp;nbsp; var height;&lt;BR /&gt;&amp;nbsp; output out=p75dataset p75=p75DSvar;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*Store 75 percentile in a macro variable*/&lt;BR /&gt;data _null_;&lt;BR /&gt;&amp;nbsp; set p75dataset;&lt;BR /&gt;&amp;nbsp; call symputx('p75Mvalue',p75DSvar);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*Find the subset*/&lt;BR /&gt;data subset;&lt;BR /&gt;&amp;nbsp; set sashelp.class;&lt;BR /&gt;&amp;nbsp; where height&amp;gt;=&amp;amp;p75Mvalue;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 12:22:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117319#M293121</guid>
      <dc:creator>Fraktalnisse</dc:creator>
      <dc:date>2013-01-07T12:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Observations above the 75th percentile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117320#M293122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PROC RANK will do it also:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC RANK DATA=nicholas.combined(where=(combo contains '21603')) GROUPS=4 OUT=nicholas._21603_(where=(rank_var=3));&lt;/P&gt;&lt;P&gt;VAR '50501'n;&lt;/P&gt;&lt;P&gt;RANKS rank_var;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 17:42:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117320#M293122</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2013-01-07T17:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Observations above the 75th percentile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117321#M293123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My goodness I have a lot to learn....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll give these approaches a try and get back after I do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 19:52:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117321#M293123</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2013-01-07T19:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Observations above the 75th percentile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117322#M293124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could I create a variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p75 = pctl(75, '50501'n);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then use that in the where data step?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;'50501'n &amp;gt;= p75(75, '50501'n);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sure seems reasonable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 23:23:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117322#M293124</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2013-01-07T23:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Observations above the 75th percentile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117323#M293125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the output of the pctl function.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data class;&lt;/P&gt;&lt;P&gt;set sashelp.class;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;test=pctl(75, weight);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PCTL is a ROW operation, it calculates the 75th percentile across the row, which for one variable is the variable value.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to do something like above use @fraktalnisse suggestion above.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 23:26:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117323#M293125</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-01-07T23:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Observations above the 75th percentile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117324#M293126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pctl() being a row-only function, wouldn't seem to have much use.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 00:24:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117324#M293126</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2013-01-08T00:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: Observations above the 75th percentile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117325#M293127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is if your data is formatted wide instead of long, example below. This often happens in medical fields, ie up to 20 diagnosis per patient and 20 different dates.&lt;/P&gt;&lt;P&gt;SAS also has mean/median/average and a whole set of functions that work across the row, so you may want ensure you understand the functions you're using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Person metric1 metric2 metrc3 metric4 -- metric99&lt;/P&gt;&lt;P&gt;Person1 1 0 2 3...&amp;nbsp; 99&lt;/P&gt;&lt;P&gt;Person2 1 3 3 4... 99&lt;/P&gt;&lt;P&gt;Person3 3 5 6 3.. 99&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 16:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117325#M293127</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-01-08T16:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Observations above the 75th percentile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117326#M293128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see your point, Reeza, however..., it would certainly be quite useful and convenient to be able to use those functions on a particular column as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My example at top should be a walk in the park:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where '50501'n &amp;gt;= pctl(75, '50501'n);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately it's not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, VERY FORTUNATELY, you folks are helpful enough to show the long path to accomplish the task.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 23:22:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Observations-above-the-75th-percentile/m-p/117326#M293128</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2013-01-08T23:22:26Z</dc:date>
    </item>
  </channel>
</rss>

