<?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: Removing the lowest value in grouped variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Removing-the-lowest-value-in-grouped-variables/m-p/24679#M4211</link>
    <description>what is your preference?&lt;BR /&gt;
PROC TRANSPOSE, PROC RANK, PROC TRANSPOSE.&lt;BR /&gt;
or ARRAY handling in a data step?&lt;BR /&gt;
PeterC</description>
    <pubDate>Thu, 03 Dec 2009 07:55:25 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2009-12-03T07:55:25Z</dc:date>
    <item>
      <title>Removing the lowest value in grouped variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-the-lowest-value-in-grouped-variables/m-p/24678#M4210</link>
      <description>Hi.&lt;BR /&gt;
&lt;BR /&gt;
If I have an array -&lt;BR /&gt;
&lt;BR /&gt;
array z&lt;LI&gt; x1-x5 y1-y10;&lt;BR /&gt;
&lt;BR /&gt;
and I want to get rid of the lowest 2 values in x1-x5, and the lowest 2 values of y1-y10, how do I get rid of the values, and not the entire observation/variable? Or conversely, is there a way to just keep a subset of the kth highest values in x1-x5, y1-y10? &lt;BR /&gt;
&lt;BR /&gt;
Sorry for the bad tables, but - &lt;BR /&gt;
I have this:&lt;BR /&gt;
obs  x1 x2 x3 x4 x5  y1 y2 y3 ... y10&lt;BR /&gt;
1      10 9   2   5   3    9  9   0    ... 2&lt;BR /&gt;
2       0  0  7   10 9    3  10 9    ... 10&lt;BR /&gt;
...&lt;BR /&gt;
500   9  5   9   5    9  10   5  6   ...  7&lt;BR /&gt;
&lt;BR /&gt;
what i want is something like:&lt;BR /&gt;
&lt;BR /&gt;
obs  x1 x2 x3 x4 x5  y1 y2 y3 ... y10&lt;BR /&gt;
1      10 9   .   5   .    9  9   .    ... .&lt;BR /&gt;
2       .   .  7   10 9    .  10 9    ... 10&lt;BR /&gt;
...&lt;BR /&gt;
500   9  .   9   .    9  10   .  .   ...  7&lt;BR /&gt;
&lt;BR /&gt;
thanks!&lt;/LI&gt;</description>
      <pubDate>Wed, 02 Dec 2009 23:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-the-lowest-value-in-grouped-variables/m-p/24678#M4210</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-12-02T23:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Removing the lowest value in grouped variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-the-lowest-value-in-grouped-variables/m-p/24679#M4211</link>
      <description>what is your preference?&lt;BR /&gt;
PROC TRANSPOSE, PROC RANK, PROC TRANSPOSE.&lt;BR /&gt;
or ARRAY handling in a data step?&lt;BR /&gt;
PeterC</description>
      <pubDate>Thu, 03 Dec 2009 07:55:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-the-lowest-value-in-grouped-variables/m-p/24679#M4211</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-12-03T07:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Removing the lowest value in grouped variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-the-lowest-value-in-grouped-variables/m-p/24680#M4212</link>
      <description>Knowing how to do it in an array within the data step would be my preference. I thought about trying the transpose rank transpose but it seems like an inefficient way to go about it.</description>
      <pubDate>Thu, 03 Dec 2009 09:06:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-the-lowest-value-in-grouped-variables/m-p/24680#M4212</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-12-03T09:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Removing the lowest value in grouped variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-the-lowest-value-in-grouped-variables/m-p/24681#M4213</link>
      <description>Which Smallest.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data have;   &lt;BR /&gt;
   input x1-x5 y1 y2 y3 y10;&lt;BR /&gt;
   array x[5];&lt;BR /&gt;
   array y&lt;LI&gt; y:;&lt;BR /&gt;
   when='Before';&lt;BR /&gt;
   output;&lt;BR /&gt;
   do i = 2,1;&lt;BR /&gt;
      x[whichN(smallest(i,of x&lt;/LI&gt;&lt;LI&gt;),of x&lt;/LI&gt;&lt;LI&gt;)] = .;&lt;BR /&gt;
      y[whichN(smallest(i,of y&lt;/LI&gt;&lt;LI&gt;),of y&lt;/LI&gt;&lt;LI&gt;)] = .;&lt;BR /&gt;
      end;&lt;BR /&gt;
   when='After';&lt;BR /&gt;
   output;&lt;BR /&gt;
   cards;&lt;BR /&gt;
10 9 2 5 3 9 9 0 2&lt;BR /&gt;
0 0 7 10 9 3 10 9 10&lt;BR /&gt;
9 5 9 5 9 10 5 6 7&lt;BR /&gt;
;;;;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc print; &lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]&lt;/LI&gt;</description>
      <pubDate>Thu, 03 Dec 2009 12:07:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-the-lowest-value-in-grouped-variables/m-p/24681#M4213</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2009-12-03T12:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Removing the lowest value in grouped variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-the-lowest-value-in-grouped-variables/m-p/24682#M4214</link>
      <description>Does this hold good only for two smallest values?if the need be for 3 or 4 lowest values how will this work?&lt;BR /&gt;
I have gone through the documentation and the example is not clearly explained.</description>
      <pubDate>Thu, 03 Dec 2009 16:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-the-lowest-value-in-grouped-variables/m-p/24682#M4214</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2009-12-03T16:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Removing the lowest value in grouped variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-the-lowest-value-in-grouped-variables/m-p/24683#M4215</link>
      <description>Thank you _null_, that is exactly what I was looking for. I'll have to jot that one down for future reference.&lt;BR /&gt;
&lt;BR /&gt;
Cheers!</description>
      <pubDate>Thu, 03 Dec 2009 21:59:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-the-lowest-value-in-grouped-variables/m-p/24683#M4215</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-12-03T21:59:18Z</dc:date>
    </item>
  </channel>
</rss>

