<?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 how to remove outliers in each sub group? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-outliers-in-each-sub-group/m-p/805729#M317389</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.PNG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70074iD818BBB019938179/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.PNG" alt="3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I obtained the data like the above. What I am trying to do is to remove the top/bottom 1 percentile for each quarter in each year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to find in this community but could not find any about removing outliers in sub-categories. I guess I can specify a variable to be removed (gaap and non-g in this case) and can also specify subgroups (QTR and year).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 03 Apr 2022 16:33:50 GMT</pubDate>
    <dc:creator>JKCho</dc:creator>
    <dc:date>2022-04-03T16:33:50Z</dc:date>
    <item>
      <title>how to remove outliers in each sub group?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-outliers-in-each-sub-group/m-p/805729#M317389</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.PNG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70074iD818BBB019938179/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.PNG" alt="3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I obtained the data like the above. What I am trying to do is to remove the top/bottom 1 percentile for each quarter in each year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to find in this community but could not find any about removing outliers in sub-categories. I guess I can specify a variable to be removed (gaap and non-g in this case) and can also specify subgroups (QTR and year).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Apr 2022 16:33:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-outliers-in-each-sub-group/m-p/805729#M317389</guid>
      <dc:creator>JKCho</dc:creator>
      <dc:date>2022-04-03T16:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove outliers in each sub group?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-outliers-in-each-sub-group/m-p/805734#M317390</link>
      <description>&lt;P&gt;To identify the TOP and BOTTOM 1-percentile of each year and quarter, use PROC RANK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc rank data=have out=ranked groups=100;
    by year qtr;
    var gaap non_g;
    ranks r_gaap r_non_g;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This creates 100 groups in variables r_gaap and r_non_g in data set RANKED, each with numbers 0 to 99 within each YEAR and QTR combination, where 0 is the 1-st percentile. From there, a simple data step with a WHERE statement will remove the bottom 1-percentile and top 1-percentile within each year and qtr.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Better yet (in my opinion) instead of removing observations: turn the lowest 1-percentile and highest 1-percentile into missing values, as removing observations will be problems if for an observation gaap is lowest 1-percentile but non_g is not lowest 1-percentile.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 12:19:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-outliers-in-each-sub-group/m-p/805734#M317390</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-04-04T12:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove outliers in each sub group?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-outliers-in-each-sub-group/m-p/805960#M317505</link>
      <description>oh, this way is gorgeous!&lt;BR /&gt;I just come up with&lt;BR /&gt;data=one set=have;&lt;BR /&gt;if year=2000; qtr=1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;and making something like the above 80 times... you saved me! thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Mon, 04 Apr 2022 23:52:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-outliers-in-each-sub-group/m-p/805960#M317505</guid>
      <dc:creator>JKCho</dc:creator>
      <dc:date>2022-04-04T23:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove outliers in each sub group?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-outliers-in-each-sub-group/m-p/806008#M317522</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/270067"&gt;@JKCho&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;oh, this way is gorgeous!&lt;BR /&gt;I just come up with&lt;BR /&gt;data=one set=have;&lt;BR /&gt;if year=2000; qtr=1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;and making something like the above 80 times... you saved me! thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/270067"&gt;@JKCho&lt;/a&gt;&amp;nbsp;that's ridiculous to do it 80 times. One DATA step does it for all combinations of YEAR and QTR.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 09:50:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-outliers-in-each-sub-group/m-p/806008#M317522</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-04-05T09:50:27Z</dc:date>
    </item>
  </channel>
</rss>

