<?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: how to trim numerical variables in sas? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-to-trim-numerical-variables-in-sas/m-p/392852#M66297</link>
    <description>&lt;P&gt;this will help&amp;nbsp;&lt;A href="http://support.sas.com/kb/58/955.html" target="_self"&gt;Sample 58955: How to select or delete the top 1% and bottom 1% of observations from a data set&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 03 Sep 2017 10:13:09 GMT</pubDate>
    <dc:creator>Miracle</dc:creator>
    <dc:date>2017-09-03T10:13:09Z</dc:date>
    <item>
      <title>how to trim numerical variables in sas?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-trim-numerical-variables-in-sas/m-p/392851#M66296</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a sample including the variables of Return, Earnings and Size from 1980 to 2015. I want to remove (delete) the higher&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;and&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;lower 1% of&lt;U&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;each&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;variable's observations&lt;U&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;each year&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/U&gt;using SAS 9.4. however, I am not sure about the codes I should use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you please help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Sun, 03 Sep 2017 09:34:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-trim-numerical-variables-in-sas/m-p/392851#M66296</guid>
      <dc:creator>batool89</dc:creator>
      <dc:date>2017-09-03T09:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to trim numerical variables in sas?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-trim-numerical-variables-in-sas/m-p/392852#M66297</link>
      <description>&lt;P&gt;this will help&amp;nbsp;&lt;A href="http://support.sas.com/kb/58/955.html" target="_self"&gt;Sample 58955: How to select or delete the top 1% and bottom 1% of observations from a data set&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Sep 2017 10:13:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-trim-numerical-variables-in-sas/m-p/392852#M66297</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2017-09-03T10:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to trim numerical variables in sas?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-trim-numerical-variables-in-sas/m-p/392854#M66298</link>
      <description>thank you so much. can you please advise me how to extend the code to do this for each year?</description>
      <pubDate>Sun, 03 Sep 2017 10:50:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-trim-numerical-variables-in-sas/m-p/392854#M66298</guid>
      <dc:creator>batool89</dc:creator>
      <dc:date>2017-09-03T10:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to trim numerical variables in sas?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-trim-numerical-variables-in-sas/m-p/392855#M66299</link>
      <description>&lt;P&gt;The following delete the top and bottom 20% data for each year.&lt;/P&gt;
&lt;P&gt;If you need 1% change GROUPS=100 and NOT IN (0 99) .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data air;
 set sashelp.air;
 year=year(date);
 drop date;
run;
proc rank data=air out=temp groups=5;
by year;
var air;
ranks r_air;
run;
data want;
 set temp;
 if r_air not in (0 4);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Sep 2017 11:11:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-trim-numerical-variables-in-sas/m-p/392855#M66299</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-09-03T11:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to trim numerical variables in sas?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-trim-numerical-variables-in-sas/m-p/394313#M66365</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;This is a good approach. But Proc Rank only works when obersvation numbers are larger than GROUPS size. I did a draft based on the reference by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16719"&gt;@Miracle&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data air;
 set sashelp.retail;
 rename sales=air;
 drop date;
run;

proc means data=air noprint;
by year;
var air;
output out=stat
		p1=p1
		p99=p99;
run;

data r_air;
merge air(in=x) stat(keep=year p1 p99);
by year;
if x;
run;

data want;
 set r_air;
 if p1&amp;lt;=air&amp;lt;=p99;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Sep 2017 18:47:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-trim-numerical-variables-in-sas/m-p/394313#M66365</guid>
      <dc:creator>MINX</dc:creator>
      <dc:date>2017-09-08T18:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to trim numerical variables in sas?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-trim-numerical-variables-in-sas/m-p/399073#M66602</link>
      <description>&lt;P&gt;thank you all. I appreciate your help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried Proc Rank and it worked.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 08:59:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-trim-numerical-variables-in-sas/m-p/399073#M66602</guid>
      <dc:creator>batool89</dc:creator>
      <dc:date>2017-09-27T08:59:48Z</dc:date>
    </item>
  </channel>
</rss>

