<?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 Winsorise panel data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Winsorise-panel-data/m-p/638903#M190007</link>
    <description>&lt;P&gt;Hi, I am a new SAS user, I have panel data with many months and many stocks each month. I also have 10 other variables associated with each stock each month.I want to winsorise data following the instruction below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-For a particular observation, for example, Var_1(i,t) (Variable 1 of stock i in month t), to winsorize it, first calculate the 5th and 95th percentiles of that variable in the dataset that includes all stocks and all time periods from the start of the sample up until time t.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-If Var_1(i,t) is less than the 5th percentile, set its value to the 5th percentile value.&amp;nbsp; If Var_1(i,t) is greater than the 95th percentile, set its value to the 95th percentile value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-Repeat for all observations.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-Repeat for all variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Apr 2020 12:03:52 GMT</pubDate>
    <dc:creator>Baolinhdo</dc:creator>
    <dc:date>2020-04-10T12:03:52Z</dc:date>
    <item>
      <title>Winsorise panel data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Winsorise-panel-data/m-p/638903#M190007</link>
      <description>&lt;P&gt;Hi, I am a new SAS user, I have panel data with many months and many stocks each month. I also have 10 other variables associated with each stock each month.I want to winsorise data following the instruction below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-For a particular observation, for example, Var_1(i,t) (Variable 1 of stock i in month t), to winsorize it, first calculate the 5th and 95th percentiles of that variable in the dataset that includes all stocks and all time periods from the start of the sample up until time t.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-If Var_1(i,t) is less than the 5th percentile, set its value to the 5th percentile value.&amp;nbsp; If Var_1(i,t) is greater than the 95th percentile, set its value to the 95th percentile value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-Repeat for all observations.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-Repeat for all variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2020 12:03:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Winsorise-panel-data/m-p/638903#M190007</guid>
      <dc:creator>Baolinhdo</dc:creator>
      <dc:date>2020-04-10T12:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Winsorise panel data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Winsorise-panel-data/m-p/638904#M190008</link>
      <description>&lt;P&gt;PROC UNIVARIATE has a WINSORIZED= option, seems like that is what you need.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=procstat&amp;amp;docsetTarget=procstat_univariate_syntax01.htm&amp;amp;locale=en#procstat.univariate.proc_winsorized"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=procstat&amp;amp;docsetTarget=procstat_univariate_syntax01.htm&amp;amp;locale=en#procstat.univariate.proc_winsorized&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2020 12:06:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Winsorise-panel-data/m-p/638904#M190008</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-04-10T12:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Winsorise panel data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Winsorise-panel-data/m-p/638906#M190009</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp; wrote a blog before.&lt;/P&gt;
&lt;P&gt;Here is winsorized data code , JUST for one group .&lt;/P&gt;
&lt;P&gt;And you need SAS/IML .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have; /*Winsorized Data*/
 do i=1 to 100;
  a=ceil(ranuni(1)*100);
  b=ceil(ranuni(2)*100);
  output;
 end;
 drop i;
run;


%let low=0.05 ;
%let high=0.95 ;

proc iml;
use have;
read all var _num_ into x[c=vname];
close have;
call qntl(q,x,{&amp;amp;low ,&amp;amp;high});

do i=1 to ncol(x);
 x[loc(x[,i]&amp;lt;q[1,i]),i]=q[1,i];
 x[loc(x[,i]&amp;gt;q[2,i]),i]=q[2,i];
end;

create want from x[c=vname];
append from x;
close want;

quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Apr 2020 12:19:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Winsorise-panel-data/m-p/638906#M190009</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-04-10T12:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Winsorise panel data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Winsorise-panel-data/m-p/638911#M190011</link>
      <description>ees, banj cos gif lieen lacj ko, zalo? giao luwu hocj taapj naof. sr neeus lamf phieenf nhes. neeus banj cos sas iml thif lamf nhuw anh been duowis chir, neeus khoong cos thif pm minhf.</description>
      <pubDate>Fri, 10 Apr 2020 12:37:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Winsorise-panel-data/m-p/638911#M190011</guid>
      <dc:creator>kelxxx</dc:creator>
      <dc:date>2020-04-10T12:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Winsorise panel data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Winsorise-panel-data/m-p/638985#M190022</link>
      <description>&lt;P&gt;First read &lt;A href="https://blogs.sas.com/content/iml/2017/02/08/winsorization-good-bad-and-ugly.html" target="_self"&gt;"Winsorization: The good, the bad, and the ugly."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;After reading, if you still want to Winsorize , see &lt;A href="https://blogs.sas.com/content/iml/2015/07/15/winsorize-data.html" target="_self"&gt;"How to Winsorize data in SAS."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2020 14:50:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Winsorise-panel-data/m-p/638985#M190022</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-04-10T14:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Winsorise panel data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Winsorise-panel-data/m-p/639101#M190052</link>
      <description>Thanks! I wonder how the part “from the start of the sample until time t” will be resolved? Should I use a do loop?&lt;BR /&gt;&lt;BR /&gt;It seems like the most critical part in my question is until time t for each observation rather than winsorising the whole sample at once?</description>
      <pubDate>Sat, 11 Apr 2020 00:21:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Winsorise-panel-data/m-p/639101#M190052</guid>
      <dc:creator>Baolinhdo</dc:creator>
      <dc:date>2020-04-11T00:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Winsorise panel data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Winsorise-panel-data/m-p/639117#M190064</link>
      <description>Hi, minh ko co zalo sorry b&lt;BR /&gt;Thank you nhe</description>
      <pubDate>Sat, 11 Apr 2020 05:10:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Winsorise-panel-data/m-p/639117#M190064</guid>
      <dc:creator>Baolinhdo</dc:creator>
      <dc:date>2020-04-11T05:10:36Z</dc:date>
    </item>
  </channel>
</rss>

