<?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: splitting data sets into 10 decile portfolios ranked on the past 3 year volatility in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/splitting-data-sets-into-10-decile-portfolios-ranked-on-the-past/m-p/587466#M28743</link>
    <description>&lt;P&gt;Hi mKeintz,&lt;/P&gt;&lt;P&gt;About your first Question correct! so i want to establish rolling window sd for each stock, then create volatility deciles in each month.&amp;nbsp; for example this is the Code for stata (bys month_variable: astile vol_decile=sd_3, nq(10), then create equal-weighted Returns for each decile. bys vol_deciles month_variable: egen Portfolio_ret = mean(Returns), then reduce the data to the Portfolio Level. bys vol_decil vol_deciles month_variable:keep if _n= _N. About your Question:&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Do you have a SAS/ETS license?&amp;nbsp; ETS (econometric-time-series) includes PROC EXPAND, which is intended for such tasks as generating statistics for rolling Windows!&lt;/SPAN&gt;, i have SAS University Edition, so i don't know if it Permits me to do that, if not could you tell me please what to do to get SAS/ETS License?. About your Question:&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;would you rather have one observations for each date, containing 303 decile assignment?&lt;/SPAN&gt; what i Need at the end is to have decile Portfolio like this example: &lt;FONT&gt;&lt;A href="https://www.screencast.com/t/kxnHXgEs" target="_blank" rel="noopener"&gt;https://www.screencast.com/t/kxnHXgEs&lt;/A&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you please help me mKeintz, i Need this Work for my Thesis and i have just 3 weeks left. Thanks in Advance!&lt;/P&gt;</description>
    <pubDate>Tue, 10 Sep 2019 10:12:55 GMT</pubDate>
    <dc:creator>MarthelF</dc:creator>
    <dc:date>2019-09-10T10:12:55Z</dc:date>
    <item>
      <title>splitting data sets into 10 decile portfolios ranked on the past 3 year volatility</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/splitting-data-sets-into-10-decile-portfolios-ranked-on-the-past/m-p/586900#M28728</link>
      <description>&lt;P&gt;hey People,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have a data sets of 303 firms from europe and want to create 10 decile Portfolio ranked on the past 3 year volatility. each Portfolio should be created at the end of each month. i have already calculated the equal weighted return on my Excel data on the Attachments, and i tried to sort the data on decile as you can see on my SAS Code but the Problem is that i just created the colomn named volatility but i Need now to calculate the volatility because all the data inside my table are uncorrect and are the same data of LogReturn . thanks for your Help!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME REFFILE '/folders/myshortcuts/MyFolders/SaS_Stoxx300.xlsx';
PROC IMPORT DATAFILE=REFFILE
  DBMS=XLSX
  OUT=WORK.IMPORT
  replace;
  GETNAMES=yes;
  SHEET="LogReturn";
  RANGE='a3:zz99999999999'n;
RUN;

proc sort data=work.import(keep=_numeric_);
  by date;
run;

proc transpose 
      data=work.import  
      out=work.transposed(rename=(_label_=Firm Volatility1=Volatility) where=(not missing(Volatility)) drop=_name_)
      prefix=Volatility;
  by date;
run;

proc rank data=work.transposed groups=10 descending out=work.ranked;
  var Volatility;
  ranks Decile;
  by date;
run;

proc sort data=work.ranked;
  by date decile;
run;

proc print data=work.ranked;
  by date;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;. I will be grateful on your Help. thanks you in Advance. &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 22:43:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/splitting-data-sets-into-10-decile-portfolios-ranked-on-the-past/m-p/586900#M28728</guid>
      <dc:creator>MarthelF</dc:creator>
      <dc:date>2019-09-06T22:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: splitting data sets into 10 decile portfolios ranked on the past 3 year volatility</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/splitting-data-sets-into-10-decile-portfolios-ranked-on-the-past/m-p/586932#M28729</link>
      <description>&lt;P&gt;Could you show a sample of what your work.import looks like?&amp;nbsp; This would make it easier to understand how to implement your objective.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2019 03:45:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/splitting-data-sets-into-10-decile-portfolios-ranked-on-the-past/m-p/586932#M28729</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2019-09-07T03:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: splitting data sets into 10 decile portfolios ranked on the past 3 year volatility</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/splitting-data-sets-into-10-decile-portfolios-ranked-on-the-past/m-p/586978#M28731</link>
      <description>&lt;P&gt;Hi Keintz, i'm trying to upload what you mean as a Photos, i get error. but i think i you apply with my data source from Excel and the SAS Code on your Pc you'll get this Work.import. Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2019 14:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/splitting-data-sets-into-10-decile-portfolios-ranked-on-the-past/m-p/586978#M28731</guid>
      <dc:creator>MarthelF</dc:creator>
      <dc:date>2019-09-07T14:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: splitting data sets into 10 decile portfolios ranked on the past 3 year volatility</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/splitting-data-sets-into-10-decile-portfolios-ranked-on-the-past/m-p/586999#M28732</link>
      <description>&lt;P&gt;I have not been on this forum for several months, so perhaps I'm not seeing what is there.&amp;nbsp; But I do NOT see a link to an uploaded spreadsheet that you tells me to use.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2019 21:23:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/splitting-data-sets-into-10-decile-portfolios-ranked-on-the-past/m-p/586999#M28732</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2019-09-07T21:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: splitting data sets into 10 decile portfolios ranked on the past 3 year volatility</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/splitting-data-sets-into-10-decile-portfolios-ranked-on-the-past/m-p/587002#M28733</link>
      <description>&lt;P&gt;sorry Maybe i've forgotten to upload the Excel Data, i've done it below. thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2019 22:14:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/splitting-data-sets-into-10-decile-portfolios-ranked-on-the-past/m-p/587002#M28733</guid>
      <dc:creator>MarthelF</dc:creator>
      <dc:date>2019-09-07T22:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: splitting data sets into 10 decile portfolios ranked on the past 3 year volatility</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/splitting-data-sets-into-10-decile-portfolios-ranked-on-the-past/m-p/587409#M28742</link>
      <description>&lt;P&gt;OK, so you have a variable DATE, plus 303 other variables with monthly returns.&amp;nbsp; And you want volatility for each security over rolling 36-month windows, is that correct?&amp;nbsp; If so, then you want to establish rolling standard deviations prior to transpose.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have a SAS/ETS license?&amp;nbsp; ETS (econometric-time-series) includes PROC EXPAND, which is intended for such tasks as generating statistics for rolling windows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And in the end, you may not need proc transpose.&amp;nbsp; Your program attempts to make 303 observations for each date, containing the stock id and a decile. Or would you rather have one observations for each date, containing 303 decile assignment?&amp;nbsp; If it's the latter, you don't need the transpose.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 03:35:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/splitting-data-sets-into-10-decile-portfolios-ranked-on-the-past/m-p/587409#M28742</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2019-09-10T03:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: splitting data sets into 10 decile portfolios ranked on the past 3 year volatility</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/splitting-data-sets-into-10-decile-portfolios-ranked-on-the-past/m-p/587466#M28743</link>
      <description>&lt;P&gt;Hi mKeintz,&lt;/P&gt;&lt;P&gt;About your first Question correct! so i want to establish rolling window sd for each stock, then create volatility deciles in each month.&amp;nbsp; for example this is the Code for stata (bys month_variable: astile vol_decile=sd_3, nq(10), then create equal-weighted Returns for each decile. bys vol_deciles month_variable: egen Portfolio_ret = mean(Returns), then reduce the data to the Portfolio Level. bys vol_decil vol_deciles month_variable:keep if _n= _N. About your Question:&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Do you have a SAS/ETS license?&amp;nbsp; ETS (econometric-time-series) includes PROC EXPAND, which is intended for such tasks as generating statistics for rolling Windows!&lt;/SPAN&gt;, i have SAS University Edition, so i don't know if it Permits me to do that, if not could you tell me please what to do to get SAS/ETS License?. About your Question:&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;would you rather have one observations for each date, containing 303 decile assignment?&lt;/SPAN&gt; what i Need at the end is to have decile Portfolio like this example: &lt;FONT&gt;&lt;A href="https://www.screencast.com/t/kxnHXgEs" target="_blank" rel="noopener"&gt;https://www.screencast.com/t/kxnHXgEs&lt;/A&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you please help me mKeintz, i Need this Work for my Thesis and i have just 3 weeks left. Thanks in Advance!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 10:12:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/splitting-data-sets-into-10-decile-portfolios-ranked-on-the-past/m-p/587466#M28743</guid>
      <dc:creator>MarthelF</dc:creator>
      <dc:date>2019-09-10T10:12:55Z</dc:date>
    </item>
  </channel>
</rss>

