<?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 do I use SAS Procedure For simple Stock Analysis / SQL? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-use-SAS-Procedure-For-simple-Stock-Analysis-SQL/m-p/398317#M66583</link>
    <description>&lt;P&gt;Your CSV file, presumably the input data, appears to have annual returns for each PERMNO.&amp;nbsp;&amp;nbsp;But your rolling 2-year returns don't appear to be calculated directly from the reported 1-year returns.&amp;nbsp; For instance, your file has 2-year return for MACYS 2016 as &lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;.1826&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;, but calculating directly from the annual returns (2015=.0640, 2016=.3011), I get &lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;.1766&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;&amp;nbsp; (&lt;EM&gt;=sqrt[(1+0.3011)*(1+.0640)]-1&lt;/EM&gt;).&amp;nbsp; Are you generating each of your returns independently from from monthly returns?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If&amp;nbsp;you don't have monthly or quarterly returns, exactly what formula do you want to use to get the requested quarterly and semi-annual returns from the annual returns?&amp;nbsp;&amp;nbsp; For instance, one could calculate every quarterly return in a given year as&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;(1+annual_return)**0.25 -1)&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; leading to annual steps between series of 4 identical quarterly returns.&amp;nbsp; Or you might use PROC EXPAND which can be asked to smooth out those values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 23 Sep 2017 21:41:48 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2017-09-23T21:41:48Z</dc:date>
    <item>
      <title>How do I use SAS Procedure For simple Stock Analysis / SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-use-SAS-Procedure-For-simple-Stock-Analysis-SQL/m-p/398307#M66582</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am still somewhat new to SAS (last year) and haven't used it in a while. Can someone please help with using either Proc sql or other data/Proc steps that come to mind to get me started in answering the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. 3, 6, 12month, 1 year, &amp;nbsp;2 year:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - mean Stock returns by company&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - Standard deviations for these time horizons.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Create a new data set for 1 and merge that with original data set by company name only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Employ do loops (if/then?) or macros to create another dataset with the same calculations for 1 and 2 above? The aim is for me to understand how you're using do loops or macros for increased efficiency in future tasks like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have attached the CSV file. Any input is appreciated including how you loaded the data (data step with lib reference or Proc import?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2017 19:18:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-use-SAS-Procedure-For-simple-Stock-Analysis-SQL/m-p/398307#M66582</guid>
      <dc:creator>blakezen07</dc:creator>
      <dc:date>2017-09-23T19:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use SAS Procedure For simple Stock Analysis / SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-use-SAS-Procedure-For-simple-Stock-Analysis-SQL/m-p/398317#M66583</link>
      <description>&lt;P&gt;Your CSV file, presumably the input data, appears to have annual returns for each PERMNO.&amp;nbsp;&amp;nbsp;But your rolling 2-year returns don't appear to be calculated directly from the reported 1-year returns.&amp;nbsp; For instance, your file has 2-year return for MACYS 2016 as &lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;.1826&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;, but calculating directly from the annual returns (2015=.0640, 2016=.3011), I get &lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;.1766&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;&amp;nbsp; (&lt;EM&gt;=sqrt[(1+0.3011)*(1+.0640)]-1&lt;/EM&gt;).&amp;nbsp; Are you generating each of your returns independently from from monthly returns?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If&amp;nbsp;you don't have monthly or quarterly returns, exactly what formula do you want to use to get the requested quarterly and semi-annual returns from the annual returns?&amp;nbsp;&amp;nbsp; For instance, one could calculate every quarterly return in a given year as&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;(1+annual_return)**0.25 -1)&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; leading to annual steps between series of 4 identical quarterly returns.&amp;nbsp; Or you might use PROC EXPAND which can be asked to smooth out those values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2017 21:41:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-use-SAS-Procedure-For-simple-Stock-Analysis-SQL/m-p/398317#M66583</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-09-23T21:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use SAS Procedure For simple Stock Analysis / SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-use-SAS-Procedure-For-simple-Stock-Analysis-SQL/m-p/398318#M66584</link>
      <description>&lt;P&gt;Thank you for your note, that's very helpful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To to your point, the returns are generated independently. Let's assume that they are accurate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;basically I want to indepedenetply calculate returns and answer 1-3 above. How would I set up Proc expand? I am working on using Proc sql so any guidance on the code for the two would be very helpful.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2017 22:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-use-SAS-Procedure-For-simple-Stock-Analysis-SQL/m-p/398318#M66584</guid>
      <dc:creator>blakezen07</dc:creator>
      <dc:date>2017-09-23T22:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use SAS Procedure For simple Stock Analysis / SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-use-SAS-Procedure-For-simple-Stock-Analysis-SQL/m-p/398324#M66585</link>
      <description>&lt;P&gt;I should have mentioned that PROC EXPAND is part of SAS/ETS.&amp;nbsp; Do you have the SAS/ETS license?&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2017 23:11:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-use-SAS-Procedure-For-simple-Stock-Analysis-SQL/m-p/398324#M66585</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-09-23T23:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use SAS Procedure For simple Stock Analysis / SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-use-SAS-Procedure-For-simple-Stock-Analysis-SQL/m-p/398326#M66586</link>
      <description>Unfortunately I don't. I used SAS EG one year ago but I only have access to SAS University edition at the moment until next month when I renew my EG license.</description>
      <pubDate>Sat, 23 Sep 2017 23:32:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-use-SAS-Procedure-For-simple-Stock-Analysis-SQL/m-p/398326#M66586</guid>
      <dc:creator>blakezen07</dc:creator>
      <dc:date>2017-09-23T23:32:48Z</dc:date>
    </item>
  </channel>
</rss>

